test(codepipeline): wait for rollback terminal events (#6300)

Wait for asynchronous terminal event delivery before checking the exact event sequence.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-10-22 21:23:17 -04:00
1 parent 201ce60b61
commit 9eaa4404a4
1 file changed
+4 -1
@@ -32,6 +32,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -315,7 +316,9 @@ class CodePipelineRetryRollbackTest {
REGION, ACCOUNT).path("pipelineExecutionId").asText();
awaitStatus("started-event", rollbackId, "Succeeded");
assertEquals(List.of("STARTED", "SUCCEEDED"), pipelineStates(eventBridge, rollbackId));
// The terminal status becomes visible before the runner publishes its final event.
await().atMost(10, TimeUnit.SECONDS).untilAsserted(() ->
assertEquals(List.of("STARTED", "SUCCEEDED"), pipelineStates(eventBridge, rollbackId)));
}
// Catches: a rollback whose scheduling is rejected leaving the STARTED event without a FAILED one.