From cd673afcd8bc668e241e6a2950dc7013dc1bc876 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 11 Jul 2026 20:55:33 +1200 Subject: [PATCH] test(realtime): tolerate non-growing build logs between deployment updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backend-tolerant rewrite of testCreateDeployment still asserted that build logs strictly change between consecutive 'building' updates. An update event triggered by a non-log attribute change can carry unchanged logs — including two still-empty payloads early in the build — which failed assertNotEquals('', ''). Logs accumulate, so the real invariant is that they never shrink; the terminal assertNotEmpty already guarantees they eventually streamed. Co-Authored-By: Claude Fable 5 --- .../Realtime/RealtimeConsoleClientTest.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php index fa9b58a52b..f24812bf41 100644 --- a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php @@ -1090,8 +1090,11 @@ final class RealtimeConsoleClientTest extends Scope // waiting → building → ready/failed (the jobs backend has no intermediate // "processing" phase and may interleave extra update events), so assert // the meaningful milestones tolerantly rather than a fixed positional - // sequence: the build reaches "building" with a growing log, then a - // terminal "ready" carrying the build metadata. + // sequence: the build reaches "building" with an accumulating log, then + // a terminal "ready" carrying the build metadata. Consecutive updates + // may carry unchanged (even still-empty) logs when triggered by a + // non-log attribute change, so logs are only required to never shrink; + // the terminal assertions below guarantee they eventually streamed. $sawBuilding = false; $previousBuildLogs = null; $payload = null; @@ -1108,9 +1111,13 @@ final class RealtimeConsoleClientTest extends Scope if ($payload['status'] === 'building') { $sawBuilding = true; if ($previousBuildLogs !== null) { - $this->assertNotEquals($previousBuildLogs, $payload['buildLogs']); + $this->assertGreaterThanOrEqual( + \strlen($previousBuildLogs), + \strlen((string) $payload['buildLogs']), + 'Build logs must never shrink between deployment updates.' + ); } - $previousBuildLogs = $payload['buildLogs']; + $previousBuildLogs = (string) $payload['buildLogs']; } if ($payload['status'] === 'ready' && !empty($payload['buildDuration']) && !empty($payload['buildEndedAt'])) {