Repository navigation
[itests] Fix flaky WebTest - #2981
Merged
Merged
Conversation
CptBartender
reviewed
Oct 7, 2026
| private void waitForMBean(MBeanServer mbeanServer, ObjectName name) throws InterruptedException { | ||
| long deadline = System.currentTimeMillis() + 30000; | ||
| while (!mbeanServer.isRegistered(name) && System.currentTimeMillis() < deadline) { | ||
| Thread.sleep(500); |
Contributor
There was a problem hiding this comment.
This uses active waiting - replacing this with async calls would make it less readable but may allow us to run the unit tests concurrently. Your thoughts on this tradeoff?
Member
Author
There was a problem hiding this comment.
Thanks for the question. I would keep the bounded polling here. These itests share one Karaf container and its MBeanServer, and listViaMBean asserts on state that installViaMBean mutates, so async calls would not let them run concurrently. The tests would need isolated containers for that. The polling returns as soon as the condition holds, so it's no slower than an event-based wait, and it is simpler. I can extract a shared waitFor helper if you would like the duplication gone.
jbonofre
force-pushed
the
fix-flaky-webtest
branch
from
October 10, 2026 15:52
3d8b766 to
5f77b92
Compare
CptBartender
approved these changes
Oct 11, 2026
…ext is published Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebTest.installViaMBeanfailed intermittently on the Windows CI runner with:The test looked up the web MBean right after the
war/pax-web-karaffeatures were installed, before the MBean was registered.This change:
listViaMBeanandinstallViaMBeanuse itThread.sleep(2000)ininstallViaMBeanwith a bounded poll onWebBundles, which had the same raceTest-only change. The failure was seen on #2978 and passed on re-run with no code change.