leonardBang opened a new pull request #15578:
URL: https://github.com/apache/flink/pull/15578
## What is the purpose of the change
* This pull request use testcontainers for UpsertKafkaTableITCase to fix the
hang tests in UpsertKafkaTableITCase reported in FLINK-21516 and FLINK-21431
* The reason of the hang cases is the test clients returned latest offset
rather then earliest offset for test topic after retry about 30 times(about 20
seconds),
we can reproduce this one by debugging or running N times in IDE. The error
line is
```
if (newPartitionState.getOffset()
== KafkaTopicPartitionStateSentinel.EARLIEST_OFFSET)
{
consumerTmp.seekToBeginning(
Collections.singletonList(newPartitionState.getKafkaPartitionHandle()));
newPartitionState.setOffset(
consumerTmp.position(newPartitionState.getKafkaPartitionHandle()) - 1);
// the expected offset is -1, but returns 10 which is the latest offset
```
Due to the root cause comes from the Kafka test suite(maybe
`kafka.server.KafkaServer` or `org.apache.curator.test.TestingServer`), thus I
test in local env using standalone Kafka cluster, the hang case disappeared !
This PR use test container to replace Kafka test suite to fix the unstable
case.
## Brief change log
- Use testcontainers for all tests in UpsertKafkaTableITCase
## Verifying this change
- Run N times(N>=40) for `testTemporalJoin` in local env.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): ( no)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs
/ not documented)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]