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

ContextScopeListenerTest.testAsyncServletAsyncAfterDoGetExit() is flaky #12636

Closed
lorban opened this issue Dec 12, 2024 · 3 comments · Fixed by #12638
Closed

ContextScopeListenerTest.testAsyncServletAsyncAfterDoGetExit() is flaky #12636

lorban opened this issue Dec 12, 2024 · 3 comments · Fixed by #12638

Comments

@lorban
Copy link
Contributor

lorban commented Dec 12, 2024

Jetty version(s)
12.0.x, 12.1.x

Jetty Environment
ee10, ee11

Description

testAsyncServletAsyncAfterDoGetExit() sometimes fails with:

java.lang.AssertionError: 
Expected :<[enterScope /initialPath, doGet, enterScope /initialPath, exitScope /initialPath, asyncRunnable, exitScope /initialPath, enterScope /initialPath, asyncDispatch, exitScope /initialPath]>
Actual   :<[enterScope /initialPath, doGet, enterScope /initialPath, exitScope /initialPath, asyncRunnable, enterScope /initialPath, exitScope /initialPath, asyncDispatch, exitScope /initialPath]>

See: https://github.com/jetty/jetty.project/pull/12635/checks?check_run_id=34325977342

@gregw
Copy link
Contributor

gregw commented Dec 12, 2024

I fixed some flakyness of this test in 12.1.x as part of an unrelated PR: af40148

I realize now that this should be backported to 12.0.x. The symptoms were similar to your failure, but not identical. The issue is that without my fix, we are leaving threads in the thread pool with the server context set, so it can effect enter/exit logic.

gregw added a commit that referenced this issue Dec 12, 2024
@gregw gregw closed this as completed in cd4a09b Dec 14, 2024
@gregw
Copy link
Contributor

gregw commented Dec 14, 2024

@lorban Do you have a way to trigger the flakyness to see if the backport helped?

@lorban
Copy link
Contributor Author

lorban commented Dec 16, 2024

@gregw when I configure Intellij to run the test until failure and load my machine a bit, it usually fails within less than a minute. That's the best I have.

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

Successfully merging a pull request may close this issue.

2 participants