Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-3228] Fix flaky KinesisMockReadTest #4686

Merged

Conversation

aromanenko-dev
Copy link
Contributor

@aromanenko-dev aromanenko-dev commented Feb 14, 2018

The actual cause of flaky test is related to ShardReadersPoolTest (not to KinesisMockReadTest directly) which creates new instance of ShardReadersPool in every test and then starts new thread pool and runs shard readers threads.
Seems like when we run Kinesis tests in parallel through maven-surefire-plugin and KinesisMockReadTest or KinesisMockWriteTest (they also use ShardReadersPoolTest) runs after ShardReadersPoolTest then we can have a deadlock. It's easy to reproduce running two tests in this order.
To avoid it, we have to stop all running threads and release all resources by stopping shard reader pool after using.
After that, we don't need to set forkCount=1 in maven-surefire-plugin anymore.


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand:
    • What the pull request does
    • Why it does it
    • How it does it
    • Why this approach
  • Each commit in the pull request should have a meaningful subject line and body.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@aromanenko-dev
Copy link
Contributor Author

Hi @kennknowles @pawel-kaczmarczyk , can you please take a look?

@pawel-kaczmarczyk
Copy link
Contributor

Great, it LGTM!

@kennknowles
Copy link
Member

run java gradle precommit

@aromanenko-dev
Copy link
Contributor Author

retest this please

@iemejia iemejia self-requested a review February 15, 2018 09:59
Copy link
Member

@iemejia iemejia left a comment

Choose a reason for hiding this comment

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

LGTM

@iemejia
Copy link
Member

iemejia commented Feb 15, 2018

Run Java Gradle PreCommit

@iemejia iemejia merged commit d333ba5 into apache:master Feb 15, 2018
@iemejia
Copy link
Member

iemejia commented Feb 15, 2018

Thanks @aromanenko-dev !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants