jbonofre commented on code in PR #2981:
URL: https://github.com/apache/karaf/pull/2981#discussion_r4238222024
##########
itests/test/src/test/java/org/apache/karaf/itests/WebTest.java:
##########
@@ -119,4 +125,12 @@ public void installViaMBean() throws Exception {
assertContains("Hello World!", buffer.toString());
}
+ private void waitForMBean(MBeanServer mbeanServer, ObjectName name) throws
InterruptedException {
+ long deadline = System.currentTimeMillis() + 30000;
+ while (!mbeanServer.isRegistered(name) && System.currentTimeMillis() <
deadline) {
+ Thread.sleep(500);
Review 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]