From 9d674ebb267be087104687fa9f4abb68574c7d2a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 15 Jul 2026 02:33:49 +0000 Subject: [PATCH 1/4] test: fix flaky timeout in channel-management beforeEach navigation The beforeEach hook navigates to /home before every test and could burn the entire 60s test timeout when the CI runner is slow: page.goto waits for the 'load' event (observed taking ~30s), and the client boot can get stuck on the loading screen, leaving the Home heading invisible until the test times out (as seen in 'should unignore user1 messages'). Navigate with waitUntil: 'domcontentloaded' so the hook waits on the Home heading instead of full asset loading, bound the first wait to 15s, and recover from a stuck boot with a single reload before waiting again. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GYTXKLTT79eSBmX2sz1WeE --- apps/meteor/tests/e2e/channel-management.spec.ts | 12 ++++++++++-- apps/meteor/tests/e2e/page-objects/home-channel.ts | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index 40d6c757d3183..72d4021fbec2b 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -21,8 +21,16 @@ test.describe.serial('channel-management', () => { test.beforeEach(async ({ page }) => { poHomeChannel = new HomeChannel(page); - await page.goto('/home'); - await poHomeChannel.waitForHome(); + // Waiting for the 'load' event can consume most of the test timeout on a busy CI runner, + // and the client boot can occasionally get stuck on the loading screen, so wait for the + // Home heading with a bounded timeout and recover with a single reload instead of failing + await page.goto('/home', { waitUntil: 'domcontentloaded' }); + try { + await poHomeChannel.waitForHome(15_000); + } catch { + await page.reload({ waitUntil: 'domcontentloaded' }); + await poHomeChannel.waitForHome(); + } }); test('should navigate on toolbar using arrow keys', async ({ page }) => { diff --git a/apps/meteor/tests/e2e/page-objects/home-channel.ts b/apps/meteor/tests/e2e/page-objects/home-channel.ts index 45341416f856f..ac1948b0d4c47 100644 --- a/apps/meteor/tests/e2e/page-objects/home-channel.ts +++ b/apps/meteor/tests/e2e/page-objects/home-channel.ts @@ -188,8 +188,8 @@ export class HomeChannel { await this.getEmojiByName(emoji).click(); } - async waitForHome(): Promise { - await this.homepageHeader.waitFor({ state: 'visible' }); + async waitForHome(timeout?: number): Promise { + await this.homepageHeader.waitFor({ state: 'visible', timeout }); } async waitForRoomLoad(): Promise { From 914ca1fa3da429722904cd547c3a65c3769aaddb Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 15 Jul 2026 02:53:07 +0000 Subject: [PATCH 2/4] test: use expect().toPass() retry instead of try/catch for home navigation Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GYTXKLTT79eSBmX2sz1WeE --- apps/meteor/tests/e2e/channel-management.spec.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index 72d4021fbec2b..b68d695d922ef 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -21,16 +21,13 @@ test.describe.serial('channel-management', () => { test.beforeEach(async ({ page }) => { poHomeChannel = new HomeChannel(page); - // Waiting for the 'load' event can consume most of the test timeout on a busy CI runner, - // and the client boot can occasionally get stuck on the loading screen, so wait for the - // Home heading with a bounded timeout and recover with a single reload instead of failing - await page.goto('/home', { waitUntil: 'domcontentloaded' }); - try { + // The client boot can occasionally get stuck on the loading screen on a busy CI runner, + // and only a fresh navigation recovers it, so retry the navigation with a bounded wait + // instead of letting a single attempt exhaust the whole test timeout + await expect(async () => { + await page.goto('/home', { waitUntil: 'domcontentloaded' }); await poHomeChannel.waitForHome(15_000); - } catch { - await page.reload({ waitUntil: 'domcontentloaded' }); - await poHomeChannel.waitForHome(); - } + }).toPass(); }); test('should navigate on toolbar using arrow keys', async ({ page }) => { From 3e5ce66ef39e8f2769168e33b2383f0ddaa0272a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 15 Jul 2026 07:00:38 +0000 Subject: [PATCH 3/4] test: remove implementation comment per e2e coding guidelines Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GYTXKLTT79eSBmX2sz1WeE --- apps/meteor/tests/e2e/channel-management.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index b68d695d922ef..492fca001da4a 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -21,9 +21,6 @@ test.describe.serial('channel-management', () => { test.beforeEach(async ({ page }) => { poHomeChannel = new HomeChannel(page); - // The client boot can occasionally get stuck on the loading screen on a busy CI runner, - // and only a fresh navigation recovers it, so retry the navigation with a bounded wait - // instead of letting a single attempt exhaust the whole test timeout await expect(async () => { await page.goto('/home', { waitUntil: 'domcontentloaded' }); await poHomeChannel.waitForHome(15_000); From 8f1f11826822706452c8c460090e8890b2d38389 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 15 Jul 2026 07:02:05 +0000 Subject: [PATCH 4/4] test: bound home navigation retry to 30s An unbounded toPass() retries until the overall test timeout, which reproduces the opaque 'timeout exceeded in beforeEach' failure when the client boot is stuck for good. A 30s budget still allows two full navigation attempts and fails with a clear toPass timeout error instead. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GYTXKLTT79eSBmX2sz1WeE --- apps/meteor/tests/e2e/channel-management.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index 492fca001da4a..4edcc6fca8918 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -24,7 +24,7 @@ test.describe.serial('channel-management', () => { await expect(async () => { await page.goto('/home', { waitUntil: 'domcontentloaded' }); await poHomeChannel.waitForHome(15_000); - }).toPass(); + }).toPass({ timeout: 30_000 }); }); test('should navigate on toolbar using arrow keys', async ({ page }) => {