gnodet-bot commented on code in PR #30657:
URL: https://github.com/apache/camel/pull/30657#discussion_r4665048658
##########
components/camel-kubernetes/src/test/java/org/apache/camel/component/kubernetes/cluster/KubernetesClusterViewStopTest.java:
##########
@@ -214,7 +216,8 @@ void
testStopOfManyGroupsDoesNotWaitWhenTheLastLookupFailed(LeaseResourceType ty
service.stop();
long millis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
- assertTrue(millis < RENEW_DEADLINE_MILLIS / 2, "The stop of " +
GROUPS.size() + " groups took " + millis + " ms");
+ // a release that is tried waits until the renew deadline, so the stop
would take at least that long
+ assertTrue(millis < RENEW_DEADLINE_MILLIS, "The stop of " +
GROUPS.size() + " groups took " + millis + " ms");
Review Comment:
⚠️ **Weakened proof of non-waiting behavior**
The whole point of this test is to verify that when groups have already
given up leadership (requests were refused), `stop()` returns quickly *without*
waiting for the API server. The original `RENEW_DEADLINE_MILLIS / 2` asserted
that stop completed well under one renew cycle, proving the code didn't attempt
a release. With `RENEW_DEADLINE_MILLIS`, a future regression where the code
*does* attempt a release and waits the full renew deadline would only fail by
0ms of margin.
If the flakiness was caused by CI scheduling noise (values landing just
above 500ms), a safer bound would be `2 * RENEW_DEADLINE_MILLIS`:
```suggestion
assertTrue(millis < 2 * RENEW_DEADLINE_MILLIS, "The stop of " +
GROUPS.size() + " groups took " + millis + " ms");
```
This gives headroom for scheduling noise while still failing decisively if a
release is attempted (which takes at least `RENEW_DEADLINE_MILLIS = 1000ms`).
Could you confirm what values were observed when the test failed on CI?
--
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]