-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Interrupted test cases cause random failures with thread reuse #1688
Comments
Tentatively slated for 5.4 M1 for team discussion. |
I added |
Inserting @junit-team/junit-lambda, As for whether or not that is the correct location to invoke |
I have removed the |
Team Decision: Reset the flag before/after executing a |
in progress |
Status Quo
Whenever a test case is interrupted (
Thread.interrupt()
), the test runner thread seems to stay in interrupted state. This causes random failures later when the thread is reused for other test cases.Expected Behavior
When the thread is reused, the interrupted flag for the thread is cleaned before starting a new test case. This can be done by calling
Thread.interrupted()
, which returns the interrupted state and clears the interrupted flag.Steps to Reproduce
The following code reproduces the problem (when run against JUnit Jupiter 5.4 snapshots), given that
test1()
is run beforetest2()
.Analysis
This problem is reproducible using both Jupiter and Vintage (tried on version 5.3.1), launching the test both from Gradle 4.10.2 and IntelliJ IDEA 2018.3 (and previous).
I guess it is the same exact bug reported in JUnit 4 (junit-team/junit4#1365)
Deliverables
Node
.The text was updated successfully, but these errors were encountered: