From 2d0340e40d7fdc58786be04a459d2dfae5d5d976 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Tue, 25 Aug 2026 17:53:49 +0800 Subject: [PATCH 01/18] fix: improve cloud sync tests to handle asynchronous loading and increase timeout --- .github/workflows/test-e2e.yml | 13 ++++++------- .../tests/smoke/cloud-sync.test.ts | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 4174c337829..b0983959eac 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -66,10 +66,9 @@ jobs: contents: read packages: read strategy: - fail-fast: false + fail-fast: true matrix: - shardIndex: [1, 2, 3, 4, 5, 6] - shardTotal: [6] + runIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] steps: - name: Harden Runner uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 @@ -100,20 +99,20 @@ jobs: name: app-build path: packages/insomnia/build/ - - name: Smoke test electron app (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + - name: Stress test flaky case (run ${{ matrix.runIndex }}/10, repeat-each=3) + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 --max-failures=1 -g "Discard, branch and commit actions" tests/smoke/cloud-sync.test.ts - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: ubuntu-smoke-test-traces-${{ github.run_number }}-shard-${{ matrix.shardIndex }} + name: ubuntu-smoke-test-traces-${{ github.run_number }}-run-${{ matrix.runIndex }} path: packages/insomnia-smoke-test/traces - name: Upload junit results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: junit-results-${{ github.run_number }}-shard-${{ matrix.shardIndex }} + name: junit-results-${{ github.run_number }}-run-${{ matrix.runIndex }} path: packages/insomnia-smoke-test/test-results.xml diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 4cfd3ea298b..f06c5abadfd 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -26,6 +26,10 @@ test.describe('Cloud Sync', () => { test('Discard, branch and commit actions', async ({ page, insomnia }) => { // Sync My Collection R1 await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My Collection R1'); + // The request tree loads asynchronously after the workspace is selected (a separate step from + // the fetch/pull spinner above), and can occasionally take longer than the default 30s action + // timeout under CI load. Wait for the row itself with extra headroom before clicking it. + await insomnia.navigationSidebar.requestRow('New Request').waitFor({ state: 'visible', timeout: 60_000 }); await insomnia.navigationSidebar.clickRequestOrFolder('New Request'); // Send request and check body await page.getByRole('button', { name: 'Send' }).click(); From 862bfff64922a092c44b34ba80abb587bdb50ab2 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Tue, 25 Aug 2026 18:01:57 +0800 Subject: [PATCH 02/18] fix: add slow test marker to improve stability of cloud sync tests --- packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index f06c5abadfd..9efed049546 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -24,6 +24,10 @@ test.describe('Cloud Sync', () => { }); test('Discard, branch and commit actions', async ({ page, insomnia }) => { + // This test's own wait below can approach the default 60s (CI) test timeout on a slow runner; + // give it real headroom so a slow-but-eventually-successful run doesn't get torn down mid-wait + // and reported as a confusing "page has been closed" error instead of a clean timeout. + test.slow(); // Sync My Collection R1 await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My Collection R1'); // The request tree loads asynchronously after the workspace is selected (a separate step from From 83863741bfb75f792cb15ed00f1b03054ba6008f Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 10:11:18 +0800 Subject: [PATCH 03/18] fix: enhance cloud sync tests by adding robust menu item click handling --- .../tests/smoke/cloud-sync.test.ts | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 9efed049546..5011b0e039c 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -1,4 +1,4 @@ -import { expect } from '@playwright/test'; +import { expect, type Page } from '@playwright/test'; import playwrightConfig from '../../playwright.config'; import { test } from '../../playwright/test'; @@ -6,6 +6,27 @@ import { test } from '../../playwright/test'; // @ts-expect-error playwrightConfig.webServer.url must exists const devServerUrl = playwrightConfig?.webServer?.url || 'http://127.0.0.1:4010'; +// Retries clicking the "Git Sync" dropdown trigger until the given menu item is visible. Needed +// right after switching workspaces: the dropdown is remounted (keyed by workspace id) while the +// new workspace's route loader is still resolving several sequential IPC calls, so a single click +// can land on the outgoing workspace's instance and open a popover that's destroyed by the +// remount, leaving the incoming instance closed with nothing to reopen it. +async function openGitSyncMenuItem(page: Page, menuItemText: string): Promise { + const gitSyncButton = page.getByLabel('Git Sync'); + const menuItem = page.getByText(menuItemText); + for (let attempt = 1; attempt <= 3; attempt++) { + await gitSyncButton.click(); + try { + await menuItem.waitFor({ state: 'visible', timeout: 2000 }); + return; + } catch { + if (attempt === 3) { + throw new Error(`Git Sync dropdown did not open with "${menuItemText}" menu item visible after 3 attempts`); + } + } + } +} + test.describe('Cloud Sync', () => { test.beforeAll(async () => { await fetch(`${devServerUrl}/__test-config/cloud-sync`, { @@ -85,7 +106,7 @@ test.describe('Cloud Sync', () => { // focused, so back out first. await insomnia.navigationSidebar.backToAllProjects(); await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My MCP Client'); - await page.getByLabel('Git Sync').click(); + await openGitSyncMenuItem(page, 'Branches'); await page.getByText('Branches').click(); const branchModal = page.getByRole('dialog'); From e09c0da8e45a0abec25602c4c8688b43f4bbc674 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 10:20:37 +0800 Subject: [PATCH 04/18] fix: improve Git Sync dropdown interaction by increasing retry attempts and timeout --- .../tests/smoke/cloud-sync.test.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 5011b0e039c..97c3882368e 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -6,22 +6,24 @@ import { test } from '../../playwright/test'; // @ts-expect-error playwrightConfig.webServer.url must exists const devServerUrl = playwrightConfig?.webServer?.url || 'http://127.0.0.1:4010'; -// Retries clicking the "Git Sync" dropdown trigger until the given menu item is visible. Needed +// Retries opening the "Git Sync" dropdown and clicking the given menu item as one unit. Needed // right after switching workspaces: the dropdown is remounted (keyed by workspace id) while the -// new workspace's route loader is still resolving several sequential IPC calls, so a single click -// can land on the outgoing workspace's instance and open a popover that's destroyed by the -// remount, leaving the incoming instance closed with nothing to reopen it. -async function openGitSyncMenuItem(page: Page, menuItemText: string): Promise { +// new workspace's route loader is still resolving several sequential IPC calls, so a click can +// open a popover that's destroyed by the next remount before it can be acted on - repeatedly, for +// longer than a single click's default timeout. Splitting "confirm it opened" from "click it" into +// two separate steps leaves a gap for the same remount to close it again in between, so both steps +// are retried together here instead. +async function clickGitSyncMenuItem(page: Page, menuItemText: string): Promise { const gitSyncButton = page.getByLabel('Git Sync'); const menuItem = page.getByText(menuItemText); - for (let attempt = 1; attempt <= 3; attempt++) { + for (let attempt = 1; attempt <= 10; attempt++) { await gitSyncButton.click(); try { - await menuItem.waitFor({ state: 'visible', timeout: 2000 }); + await menuItem.click({ timeout: 3000 }); return; } catch { - if (attempt === 3) { - throw new Error(`Git Sync dropdown did not open with "${menuItemText}" menu item visible after 3 attempts`); + if (attempt === 10) { + throw new Error(`Could not click "${menuItemText}" in the Git Sync dropdown after 10 attempts`); } } } @@ -106,8 +108,7 @@ test.describe('Cloud Sync', () => { // focused, so back out first. await insomnia.navigationSidebar.backToAllProjects(); await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My MCP Client'); - await openGitSyncMenuItem(page, 'Branches'); - await page.getByText('Branches').click(); + await clickGitSyncMenuItem(page, 'Branches'); const branchModal = page.getByRole('dialog'); const localBranchDiv = branchModal.getByLabel('Branches list', { exact: true }); From 7c66b9f1deaa743ffca1bb1c3b945632a1f26c23 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 10:31:32 +0800 Subject: [PATCH 05/18] fix: resolve tooltip interference by moving mouse off sidebar before clicking workspace row --- .../playwright/pages/components/navigation-sidebar.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts index 5e3cd993f7c..73f70a37d41 100644 --- a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts +++ b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts @@ -312,6 +312,11 @@ export class NavigationSidebar { async fetchUnsyncedWorkspace(name: string): Promise { const unsyncedWorkspaceButton = this.unsyncedWorkspaceButton(name); await unsyncedWorkspaceButton.click(); + // The fetch button has a hover tooltip ("Click to fetch this file"). Its trigger element gets + // replaced by the click above rather than the mouse actually leaving it, so the tooltip can be + // left rendered at the same screen position and intercept the workspace-row click below. Move + // the mouse off the sidebar so it dismisses before we click there again. + await this.page.mouse.move(0, 0); await expect.soft(this.unsyncedWorkspaceRow(name)).toBeHidden({ timeout: 5000 }); await expect.soft(this.workspaceRow(name)).toBeVisible(); // The sidebar list is still settling right after the unsynced row disappears From cc8a08e849fcb3a9d19ae9a9e2d13407b55329d0 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 10:56:13 +0800 Subject: [PATCH 06/18] fix: adjust cloud sync test command to improve reliability by removing max failures limit --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index b0983959eac..8ec2679e697 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -100,7 +100,7 @@ jobs: path: packages/insomnia/build/ - name: Stress test flaky case (run ${{ matrix.runIndex }}/10, repeat-each=3) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 --max-failures=1 -g "Discard, branch and commit actions" tests/smoke/cloud-sync.test.ts + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 -g "Discard, branch and commit actions" tests/smoke/cloud-sync.test.ts - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From 41904cb8f6bb73fba521a7f8714ec1c99c3c0aee Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:03:47 +0800 Subject: [PATCH 07/18] fix: update cloud sync test command to remove unnecessary flag for improved clarity --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 8ec2679e697..a5eb4918f95 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -100,7 +100,7 @@ jobs: path: packages/insomnia/build/ - name: Stress test flaky case (run ${{ matrix.runIndex }}/10, repeat-each=3) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 -g "Discard, branch and commit actions" tests/smoke/cloud-sync.test.ts + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 tests/smoke/cloud-sync.test.ts - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From cc3899b48d19434d0327845dc67c62cd1c497c28 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:10:10 +0800 Subject: [PATCH 08/18] fix: extend timeout for request row visibility to improve reliability during CI runs --- .../insomnia-smoke-test/tests/smoke/cloud-sync.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 97c3882368e..1532aed7728 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -54,9 +54,12 @@ test.describe('Cloud Sync', () => { // Sync My Collection R1 await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My Collection R1'); // The request tree loads asynchronously after the workspace is selected (a separate step from - // the fetch/pull spinner above), and can occasionally take longer than the default 30s action - // timeout under CI load. Wait for the row itself with extra headroom before clicking it. - await insomnia.navigationSidebar.requestRow('New Request').waitFor({ state: 'visible', timeout: 60_000 }); + // the fetch/pull spinner above). On CI this has been observed stalling for a fixed ~60s stretch + // with zero renderer/main-process activity, consistent with Chromium's background-tab JS + // throttling kicking in on the main window right around this workspace switch (the main window, + // unlike the plugin window, doesn't set `backgroundThrottling: false`). 60s of wait budget lands + // right on that boundary, so give real margin above it instead of chasing the exact stall length. + await insomnia.navigationSidebar.requestRow('New Request').waitFor({ state: 'visible', timeout: 90_000 }); await insomnia.navigationSidebar.clickRequestOrFolder('New Request'); // Send request and check body await page.getByRole('button', { name: 'Send' }).click(); From f5cd2ef098f90abb43c6a6c239894c7073d6d70b Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:23:43 +0800 Subject: [PATCH 09/18] fix: increase timeout for request row visibility to enhance reliability during tests --- packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 1532aed7728..26629a056b8 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -59,7 +59,7 @@ test.describe('Cloud Sync', () => { // throttling kicking in on the main window right around this workspace switch (the main window, // unlike the plugin window, doesn't set `backgroundThrottling: false`). 60s of wait budget lands // right on that boundary, so give real margin above it instead of chasing the exact stall length. - await insomnia.navigationSidebar.requestRow('New Request').waitFor({ state: 'visible', timeout: 90_000 }); + await insomnia.navigationSidebar.requestRow('New Request').waitFor({ state: 'visible', timeout: 120_000 }); await insomnia.navigationSidebar.clickRequestOrFolder('New Request'); // Send request and check body await page.getByRole('button', { name: 'Send' }).click(); From 0795946e7b0c6b4b10086aa327904e97ecee4058 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:35:04 +0800 Subject: [PATCH 10/18] fix: enhance fetchUnsyncedWorkspace to verify visibility with retries for improved CI reliability --- .../pages/components/navigation-sidebar.ts | 25 ++++++++++++++++++- .../tests/smoke/cloud-sync.test.ts | 13 +++------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts index 73f70a37d41..d0e5d07cf52 100644 --- a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts +++ b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts @@ -309,7 +309,16 @@ export class NavigationSidebar { return this.unsyncedWorkspaceRow(workspaceName).getByRole('button', { name: 'Fetch unsynced workspace' }); } - async fetchUnsyncedWorkspace(name: string): Promise { + // `verifyVisible`, when passed, is a locator for something inside the workspace (e.g. a known + // child request row) that only appears once the workspace's content has actually rendered — + // being selected (aria-selected) doesn't guarantee that. On CI this content render has been + // observed stalling for a fixed ~60s stretch with zero renderer/main-process activity, + // consistent with Chromium's background-tab JS throttling kicking in on the main window right + // around a workspace switch (the main window, unlike the plugin window, doesn't set + // `backgroundThrottling: false`). Re-clicking the workspace row is a cheap way to generate fresh + // input activity that may help unstick a throttled renderer, so retry with a fresh click in + // between instead of only waiting once. + async fetchUnsyncedWorkspace(name: string, verifyVisible?: Locator): Promise { const unsyncedWorkspaceButton = this.unsyncedWorkspaceButton(name); await unsyncedWorkspaceButton.click(); // The fetch button has a hover tooltip ("Click to fetch this file"). Its trigger element gets @@ -334,6 +343,20 @@ export class NavigationSidebar { } } } + if (!verifyVisible) { + return; + } + for (let attempt = 1; attempt <= 2; attempt++) { + try { + await verifyVisible.waitFor({ state: 'visible', timeout: 60_000 }); + return; + } catch { + if (attempt === 2) { + throw new Error(`Workspace "${name}" was selected but its content did not render after 2 attempts`); + } + await this.workspaceRow(name).click(); + } + } } // =========================================================================== diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 26629a056b8..1cd9cd4236b 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -51,15 +51,10 @@ test.describe('Cloud Sync', () => { // give it real headroom so a slow-but-eventually-successful run doesn't get torn down mid-wait // and reported as a confusing "page has been closed" error instead of a clean timeout. test.slow(); - // Sync My Collection R1 - await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My Collection R1'); - // The request tree loads asynchronously after the workspace is selected (a separate step from - // the fetch/pull spinner above). On CI this has been observed stalling for a fixed ~60s stretch - // with zero renderer/main-process activity, consistent with Chromium's background-tab JS - // throttling kicking in on the main window right around this workspace switch (the main window, - // unlike the plugin window, doesn't set `backgroundThrottling: false`). 60s of wait budget lands - // right on that boundary, so give real margin above it instead of chasing the exact stall length. - await insomnia.navigationSidebar.requestRow('New Request').waitFor({ state: 'visible', timeout: 120_000 }); + // Sync My Collection R1. fetchUnsyncedWorkspace verifies "New Request" itself renders (with a + // retry in between) rather than just that the workspace got selected - see its own comment for + // why that distinction matters on CI. + await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My Collection R1', insomnia.navigationSidebar.requestRow('New Request')); await insomnia.navigationSidebar.clickRequestOrFolder('New Request'); // Send request and check body await page.getByRole('button', { name: 'Send' }).click(); From 359245f288d84586b2bcfc3609f504d316d4d20a Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:43:50 +0800 Subject: [PATCH 11/18] fix: update cloud sync test command to allow one max failure for improved reliability --- .github/workflows/test-e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index a5eb4918f95..1fbecfbcfe3 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -100,7 +100,7 @@ jobs: path: packages/insomnia/build/ - name: Stress test flaky case (run ${{ matrix.runIndex }}/10, repeat-each=3) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 tests/smoke/cloud-sync.test.ts + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --max-failures=1 --retries=0 tests/smoke/cloud-sync.test.ts - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From e602e02598c7dcb87e7caa1eb96d2c5c9299d43f Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:51:38 +0800 Subject: [PATCH 12/18] fix: improve cloud sync test reliability by refining workspace fetching logic and removing redundant comments --- .../pages/components/navigation-sidebar.ts | 13 ------------- .../tests/smoke/cloud-sync.test.ts | 13 ------------- 2 files changed, 26 deletions(-) diff --git a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts index d0e5d07cf52..f8e95e69357 100644 --- a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts +++ b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts @@ -309,22 +309,9 @@ export class NavigationSidebar { return this.unsyncedWorkspaceRow(workspaceName).getByRole('button', { name: 'Fetch unsynced workspace' }); } - // `verifyVisible`, when passed, is a locator for something inside the workspace (e.g. a known - // child request row) that only appears once the workspace's content has actually rendered — - // being selected (aria-selected) doesn't guarantee that. On CI this content render has been - // observed stalling for a fixed ~60s stretch with zero renderer/main-process activity, - // consistent with Chromium's background-tab JS throttling kicking in on the main window right - // around a workspace switch (the main window, unlike the plugin window, doesn't set - // `backgroundThrottling: false`). Re-clicking the workspace row is a cheap way to generate fresh - // input activity that may help unstick a throttled renderer, so retry with a fresh click in - // between instead of only waiting once. async fetchUnsyncedWorkspace(name: string, verifyVisible?: Locator): Promise { const unsyncedWorkspaceButton = this.unsyncedWorkspaceButton(name); await unsyncedWorkspaceButton.click(); - // The fetch button has a hover tooltip ("Click to fetch this file"). Its trigger element gets - // replaced by the click above rather than the mouse actually leaving it, so the tooltip can be - // left rendered at the same screen position and intercept the workspace-row click below. Move - // the mouse off the sidebar so it dismisses before we click there again. await this.page.mouse.move(0, 0); await expect.soft(this.unsyncedWorkspaceRow(name)).toBeHidden({ timeout: 5000 }); await expect.soft(this.workspaceRow(name)).toBeVisible(); diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 1cd9cd4236b..1c192d05f13 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -6,13 +6,6 @@ import { test } from '../../playwright/test'; // @ts-expect-error playwrightConfig.webServer.url must exists const devServerUrl = playwrightConfig?.webServer?.url || 'http://127.0.0.1:4010'; -// Retries opening the "Git Sync" dropdown and clicking the given menu item as one unit. Needed -// right after switching workspaces: the dropdown is remounted (keyed by workspace id) while the -// new workspace's route loader is still resolving several sequential IPC calls, so a click can -// open a popover that's destroyed by the next remount before it can be acted on - repeatedly, for -// longer than a single click's default timeout. Splitting "confirm it opened" from "click it" into -// two separate steps leaves a gap for the same remount to close it again in between, so both steps -// are retried together here instead. async function clickGitSyncMenuItem(page: Page, menuItemText: string): Promise { const gitSyncButton = page.getByLabel('Git Sync'); const menuItem = page.getByText(menuItemText); @@ -47,13 +40,7 @@ test.describe('Cloud Sync', () => { }); test('Discard, branch and commit actions', async ({ page, insomnia }) => { - // This test's own wait below can approach the default 60s (CI) test timeout on a slow runner; - // give it real headroom so a slow-but-eventually-successful run doesn't get torn down mid-wait - // and reported as a confusing "page has been closed" error instead of a clean timeout. test.slow(); - // Sync My Collection R1. fetchUnsyncedWorkspace verifies "New Request" itself renders (with a - // retry in between) rather than just that the workspace got selected - see its own comment for - // why that distinction matters on CI. await insomnia.navigationSidebar.fetchUnsyncedWorkspace('My Collection R1', insomnia.navigationSidebar.requestRow('New Request')); await insomnia.navigationSidebar.clickRequestOrFolder('New Request'); // Send request and check body From 8c029fa8dff16ac5cde10180494a37642218a7ba Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 11:58:35 +0800 Subject: [PATCH 13/18] fix: improve cloud sync test reliability by changing strategy to use sharding and disabling fail-fast --- .github/workflows/test-e2e.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 1fbecfbcfe3..4174c337829 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -66,9 +66,10 @@ jobs: contents: read packages: read strategy: - fail-fast: true + fail-fast: false matrix: - runIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + shardIndex: [1, 2, 3, 4, 5, 6] + shardTotal: [6] steps: - name: Harden Runner uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 @@ -99,20 +100,20 @@ jobs: name: app-build path: packages/insomnia/build/ - - name: Stress test flaky case (run ${{ matrix.runIndex }}/10, repeat-each=3) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --max-failures=1 --retries=0 tests/smoke/cloud-sync.test.ts + - name: Smoke test electron app (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: ubuntu-smoke-test-traces-${{ github.run_number }}-run-${{ matrix.runIndex }} + name: ubuntu-smoke-test-traces-${{ github.run_number }}-shard-${{ matrix.shardIndex }} path: packages/insomnia-smoke-test/traces - name: Upload junit results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: junit-results-${{ github.run_number }}-run-${{ matrix.runIndex }} + name: junit-results-${{ github.run_number }}-shard-${{ matrix.shardIndex }} path: packages/insomnia-smoke-test/test-results.xml From c2e5d3b21f610a669281e1ba69598efe5c71b72a Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 17:34:11 +0800 Subject: [PATCH 14/18] fix: enhance cloud sync test reliability by enabling fail-fast and adjusting retry logic --- .github/workflows/test-e2e.yml | 13 ++++++------- .../tests/smoke/cloud-sync.test.ts | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 4174c337829..338edff1536 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -66,10 +66,9 @@ jobs: contents: read packages: read strategy: - fail-fast: false + fail-fast: true matrix: - shardIndex: [1, 2, 3, 4, 5, 6] - shardTotal: [6] + runIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] steps: - name: Harden Runner uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 @@ -100,20 +99,20 @@ jobs: name: app-build path: packages/insomnia/build/ - - name: Smoke test electron app (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + - name: Smoke test electron app (run ${{ matrix.runIndex }}) + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 --max-failures=1 tests/smoke/cloud-sync.test.ts - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: ubuntu-smoke-test-traces-${{ github.run_number }}-shard-${{ matrix.shardIndex }} + name: ubuntu-smoke-test-traces-${{ github.run_number }}-run-${{ matrix.runIndex }} path: packages/insomnia-smoke-test/traces - name: Upload junit results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: junit-results-${{ github.run_number }}-shard-${{ matrix.shardIndex }} + name: junit-results-${{ github.run_number }}-run-${{ matrix.runIndex }} path: packages/insomnia-smoke-test/test-results.xml diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 1c192d05f13..50331050e1e 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -9,7 +9,7 @@ const devServerUrl = playwrightConfig?.webServer?.url || 'http://127.0.0.1:4010' async function clickGitSyncMenuItem(page: Page, menuItemText: string): Promise { const gitSyncButton = page.getByLabel('Git Sync'); const menuItem = page.getByText(menuItemText); - for (let attempt = 1; attempt <= 10; attempt++) { + for (let attempt = 1; attempt <= 3; attempt++) { await gitSyncButton.click(); try { await menuItem.click({ timeout: 3000 }); From 43565db5171528cffffc9d4b715de3dfa9f7f5cc Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 17:35:16 +0800 Subject: [PATCH 15/18] fix: adjust visibility wait timeout and retry attempts for improved test reliability --- .../playwright/pages/components/navigation-sidebar.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts index f8e95e69357..4e5664f7486 100644 --- a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts +++ b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts @@ -333,9 +333,9 @@ export class NavigationSidebar { if (!verifyVisible) { return; } - for (let attempt = 1; attempt <= 2; attempt++) { + for (let attempt = 0; attempt <= 2; attempt++) { try { - await verifyVisible.waitFor({ state: 'visible', timeout: 60_000 }); + await verifyVisible.waitFor({ state: 'visible', timeout: 10_000 }); return; } catch { if (attempt === 2) { From ba34ea8c5fc14efdce17b09a7b041fd2a0bd58b2 Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Wed, 26 Aug 2026 17:50:56 +0800 Subject: [PATCH 16/18] fix: improve cloud sync test strategy by adjusting fail-fast behavior and updating matrix configuration --- .github/workflows/test-e2e.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 338edff1536..4174c337829 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -66,9 +66,10 @@ jobs: contents: read packages: read strategy: - fail-fast: true + fail-fast: false matrix: - runIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + shardIndex: [1, 2, 3, 4, 5, 6] + shardTotal: [6] steps: - name: Harden Runner uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 @@ -99,20 +100,20 @@ jobs: name: app-build path: packages/insomnia/build/ - - name: Smoke test electron app (run ${{ matrix.runIndex }}) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 --max-failures=1 tests/smoke/cloud-sync.test.ts + - name: Smoke test electron app (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: ubuntu-smoke-test-traces-${{ github.run_number }}-run-${{ matrix.runIndex }} + name: ubuntu-smoke-test-traces-${{ github.run_number }}-shard-${{ matrix.shardIndex }} path: packages/insomnia-smoke-test/traces - name: Upload junit results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: junit-results-${{ github.run_number }}-run-${{ matrix.runIndex }} + name: junit-results-${{ github.run_number }}-shard-${{ matrix.shardIndex }} path: packages/insomnia-smoke-test/test-results.xml From 8191118a6d3935d983ffd880d0d40d517a66b61e Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Thu, 27 Aug 2026 14:30:13 +0800 Subject: [PATCH 17/18] fix: enhance cloud sync test reliability by increasing retry attempts and adjusting timeouts --- .github/workflows/test-e2e.yml | 13 ++++++------- .../pages/components/navigation-sidebar.ts | 8 ++++---- .../tests/smoke/cloud-sync.test.ts | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 4174c337829..338edff1536 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -66,10 +66,9 @@ jobs: contents: read packages: read strategy: - fail-fast: false + fail-fast: true matrix: - shardIndex: [1, 2, 3, 4, 5, 6] - shardTotal: [6] + runIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] steps: - name: Harden Runner uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 @@ -100,20 +99,20 @@ jobs: name: app-build path: packages/insomnia/build/ - - name: Smoke test electron app (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + - name: Smoke test electron app (run ${{ matrix.runIndex }}) + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 --max-failures=1 tests/smoke/cloud-sync.test.ts - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: ubuntu-smoke-test-traces-${{ github.run_number }}-shard-${{ matrix.shardIndex }} + name: ubuntu-smoke-test-traces-${{ github.run_number }}-run-${{ matrix.runIndex }} path: packages/insomnia-smoke-test/traces - name: Upload junit results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: junit-results-${{ github.run_number }}-shard-${{ matrix.shardIndex }} + name: junit-results-${{ github.run_number }}-run-${{ matrix.runIndex }} path: packages/insomnia-smoke-test/test-results.xml diff --git a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts index 4e5664f7486..406eac17355 100644 --- a/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts +++ b/packages/insomnia-smoke-test/playwright/pages/components/navigation-sidebar.ts @@ -333,13 +333,13 @@ export class NavigationSidebar { if (!verifyVisible) { return; } - for (let attempt = 0; attempt <= 2; attempt++) { + for (let attempt = 0; attempt <= 10; attempt++) { try { - await verifyVisible.waitFor({ state: 'visible', timeout: 10_000 }); + await verifyVisible.waitFor({ state: 'visible', timeout: 1000 }); return; } catch { - if (attempt === 2) { - throw new Error(`Workspace "${name}" was selected but its content did not render after 2 attempts`); + if (attempt === 10) { + throw new Error(`Workspace "${name}" was selected but its content did not render after 10 attempts`); } await this.workspaceRow(name).click(); } diff --git a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts index 50331050e1e..0fed8cabd74 100644 --- a/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/cloud-sync.test.ts @@ -9,10 +9,10 @@ const devServerUrl = playwrightConfig?.webServer?.url || 'http://127.0.0.1:4010' async function clickGitSyncMenuItem(page: Page, menuItemText: string): Promise { const gitSyncButton = page.getByLabel('Git Sync'); const menuItem = page.getByText(menuItemText); - for (let attempt = 1; attempt <= 3; attempt++) { + for (let attempt = 1; attempt <= 10; attempt++) { await gitSyncButton.click(); try { - await menuItem.click({ timeout: 3000 }); + await menuItem.click({ timeout: 1000 }); return; } catch { if (attempt === 10) { From 74da8cabfa55e4b825653cf15d15eb4125a2ea9a Mon Sep 17 00:00:00 2001 From: Bob Qiu Date: Thu, 27 Aug 2026 14:40:12 +0800 Subject: [PATCH 18/18] fix: improve cloud sync test strategy by disabling fail-fast and updating matrix configuration --- .github/workflows/test-e2e.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 338edff1536..4174c337829 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -66,9 +66,10 @@ jobs: contents: read packages: read strategy: - fail-fast: true + fail-fast: false matrix: - runIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + shardIndex: [1, 2, 3, 4, 5, 6] + shardTotal: [6] steps: - name: Harden Runner uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 @@ -99,20 +100,20 @@ jobs: name: app-build path: packages/insomnia/build/ - - name: Smoke test electron app (run ${{ matrix.runIndex }}) - run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --repeat-each=3 --retries=0 --max-failures=1 tests/smoke/cloud-sync.test.ts + - name: Smoke test electron app (shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}) + run: npm run test:build -w packages/insomnia-smoke-test -- --project=Smoke --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - name: Upload smoke test traces uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: ubuntu-smoke-test-traces-${{ github.run_number }}-run-${{ matrix.runIndex }} + name: ubuntu-smoke-test-traces-${{ github.run_number }}-shard-${{ matrix.shardIndex }} path: packages/insomnia-smoke-test/traces - name: Upload junit results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: ${{ !cancelled() }} with: if-no-files-found: ignore - name: junit-results-${{ github.run_number }}-run-${{ matrix.runIndex }} + name: junit-results-${{ github.run_number }}-shard-${{ matrix.shardIndex }} path: packages/insomnia-smoke-test/test-results.xml