-
-
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
The thread context classloader is not reset between tests #2942
Comments
Thanks for raising this issue, Greg. I can't find a related issue, but if I remember correctly, we discussed whether or not to (re-)set the TCCL before each test execution at some point in the past. We ended up in not doing so, in order support use-cases that set a TCCL spanning multiple test calls. @marcphilipp and @sbrannen ... can you remember better than me? What about guarding your TCCL-aware tests? For example with a test-internal |
That was addressed in #1688.
I honestly don't recall exactly. We may have discussed that and came to that conclusion, but I cannot find a related issue either. These are the major open issues regarding class loaders: |
Actually, I found the other issue: I'm therefore closing this issue as a duplicate. |
version junit 5.8.2
Steps to reproduce
If a test that passes leaves the thread context classloader set, it may break a subsequent test, which itself passes if run by itself. For example:
Both
testA
andtestB
pass if run by themselves, but if run together, then the second always fails.I tried a similar test with the thread interrupted status and noted that we reset between test runs, so I think the thread context loader should also be reset.
Context
Failures seen in:
-- maven command line
-- Intellij IDE
The text was updated successfully, but these errors were encountered: