Skip to content

Commit 8d89458

Browse files
macfarlaclaude
andauthored
Fix flaky BackwardSyncContextTest on slow CI runners (#10000)
shouldSyncUntilHash and shouldSyncUntilRemoteBranch used isCompleted() inside untilAsserted, which only passes for normal completion. On slow CI machines the backward sync occasionally completes the future exceptionally, causing isCompleted() to fail on every retry until the 30s Awaitility timeout, which then rethrows the AssertionError. Change to isDone() inside the Awaitility block (matching the fix applied to shouldAddExpectedBlock in #9856) so Awaitility exits as soon as the future reaches any terminal state. The subsequent future.get() will then surface the real exception if the sync failed. Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 28c8a86 commit 8d89458

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public void shouldSyncUntilHash() throws Exception {
303303
.untilAsserted(
304304
() -> {
305305
respondUntilFutureIsDone(future);
306-
assertThat(future).isCompleted();
306+
assertThat(future).isDone();
307307
});
308308

309309
future.get();
@@ -337,10 +337,10 @@ public void shouldSyncUntilRemoteBranch() throws Exception {
337337
.untilAsserted(
338338
() -> {
339339
respondUntilFutureIsDone(future);
340-
assertThat(future).isCompleted();
340+
assertThat(future).isDone();
341341
});
342342

343-
future.get(); // Should succeed since we waited for completion
343+
future.get();
344344
assertThat(localBlockchain.getChainHeadBlock()).isEqualTo(remoteBlockchain.getChainHeadBlock());
345345
}
346346

0 commit comments

Comments
 (0)