Skip to content

KAFKA-8126: Fix flaky tests in WorkerTest#6475

Merged
rhauch merged 1 commit intoapache:trunkfrom
adoroszlai:KAFKA-8126
Apr 3, 2019
Merged

KAFKA-8126: Fix flaky tests in WorkerTest#6475
rhauch merged 1 commit intoapache:trunkfrom
adoroszlai:KAFKA-8126

Conversation

@adoroszlai
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fix flaky test cases in WorkerTest by mocking the ExecutorService in Worker. Previously, when using a real thread pool executor, the task may or may not have been run by the executor until the end of the test.

Related JIRA issues:

How was this patch tested?

Ran all tests (./gradlew test).
Ran unit tests in connect/runtime repeatedly.

@adoroszlai
Copy link
Copy Markdown
Contributor Author

@mjsax @guozhangwang can you please review?

@mjsax mjsax requested review from ewencp and rhauch and removed request for ewencp March 20, 2019 18:21
@rhauch rhauch changed the title [KAFKA-8126] Fix flaky tests in WorkerTest KAFKA-8126: Fix flaky tests in WorkerTest Mar 21, 2019
@adoroszlai
Copy link
Copy Markdown
Contributor Author

@rhauch could you please review?

@rhauch rhauch merged commit d3316bc into apache:trunk Apr 3, 2019
Copy link
Copy Markdown
Contributor

@rhauch rhauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks, @adoroszlai!

rhauch pushed a commit that referenced this pull request Apr 3, 2019
…stAddRemoveTask (#6475)

Changed the WorkerTest to use a mock Executor.

Author: Attila Doroszlai <adoroszlai@apache.org>
Reviewer: Randall Hauch <rhauch@gmail.com>
rhauch pushed a commit that referenced this pull request Apr 3, 2019
…stAddRemoveTask (#6475)

Changed the WorkerTest to use a mock Executor.

Author: Attila Doroszlai <adoroszlai@apache.org>
Reviewer: Randall Hauch <rhauch@gmail.com>
rhauch pushed a commit that referenced this pull request Apr 3, 2019
…stAddRemoveTask (#6475)

Changed the WorkerTest to use a mock Executor.

Author: Attila Doroszlai <adoroszlai@apache.org>
Reviewer: Randall Hauch <rhauch@gmail.com>
@adoroszlai adoroszlai deleted the KAFKA-8126 branch April 3, 2019 20:42
@adoroszlai
Copy link
Copy Markdown
Contributor Author

Thanks @rhauch for reviewing and merging it.

jarekr pushed a commit to confluentinc/kafka that referenced this pull request Apr 18, 2019
* apache/trunk:
  MINOR: Add security considerations for remote JMX in Kafka docs (apache#6544)
  MINOR: Remove redundant access specifiers from metrics interfaces (apache#6527)
  MINOR: Correct KStream documentation (apache#6552)
  KAFKA-8013; Avoid underflow when reading a Struct from a partially correct buffer (apache#6340)
  KAFKA-8058: Fix ConnectClusterStateImpl.connectors() method (apache#6384)
  MINOR: Move common consumer tests out of abstract consumer class (apache#6548)
  KAFKA-8168; Add a generated ApiMessageType class
  KAFKA-7893; Refactor ConsumerBounceTest to reuse functionality from BaseConsumerTest (apache#6238)
  MINOR: Tighten up metadata upgrade test (apache#6531)
  KAFKA-8190; Don't update keystore modification time during validation (apache#6539)
  MINOR: Fixed a few warning in core and connects (apache#6545)
  KAFKA-7904; Add AtMinIsr partition metric and TopicCommand option (KIP-427)
  MINOR: fix throttling and status in ConnectionStressWorker
  KAFKA-8090: Use automatic RPC generation in ControlledShutdown
  KAFKA-6399: Remove Streams max.poll.interval override (apache#6509)
  KAFKA-8126: Flaky Test org.apache.kafka.connect.runtime.WorkerTest.testAddRemoveTask (apache#6475)
  HOTFIX: Update unit test for KIP-443
  KAFKA-7190: KIP-443; Remove streams overrides on repartition topics (apache#6511)
  KAFKA-8183: Add retries to WorkerUtils#verifyTopics (apache#6532)
  KAFKA-8181: Removed Avro topic from TOC on kafka (apache#6529)
pengxiaolong pushed a commit to pengxiaolong/kafka that referenced this pull request Jun 14, 2019
…stAddRemoveTask (apache#6475)

Changed the WorkerTest to use a mock Executor.

Author: Attila Doroszlai <adoroszlai@apache.org>
Reviewer: Randall Hauch <rhauch@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants