Copilot commented on code in PR #12896:
URL: https://github.com/apache/ignite/pull/12896#discussion_r2940191300
##########
modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java:
##########
@@ -101,6 +102,11 @@ public void testAffinity() throws Exception {
// Expected error.
}
+ assertTrue("Failed to wait for minor version change",
+ GridTestUtils.waitForCondition(() ->
+
grid(0).context().discovery().topologyVersionEx().minorTopologyVersion() == 1,
+ 5_000));
Review Comment:
The wait predicate is brittle: it checks `minorTopologyVersion() == 1` on
`grid(0)`. If the minor version has already advanced past 1 by the time this
runs, the condition can never become true (minor version is monotonic), causing
a new flake. Also, waiting on `grid(0)` doesn’t guarantee the newly started
node has observed the topology update yet, which is what
`checkAffinity(igniteNoCache)` depends on. Consider capturing the current
topology version before `startGrid`, then waiting until the started node
(`igniteNoCache`) reaches that topology version with `minorTopologyVersion() >=
1` (or waiting for the cache to appear on `igniteNoCache`, e.g. via
`cacheNames().contains(DEFAULT_CACHE_NAME)`) using `getTestTimeout()` instead
of a fixed 5s.
--
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]