Skip to content

fix: replace NetworkIdle with Load + explicit element wait to fix Firefox integration test timeouts - #435

Draft
BenjaminMichaelis with Copilot wants to merge 2 commits into
bmichaelis/MatrixIntegrationTestsfrom
copilot/fix-copilot-issues
Draft

fix: replace NetworkIdle with Load + explicit element wait to fix Firefox integration test timeouts#435
BenjaminMichaelis with Copilot wants to merge 2 commits into
bmichaelis/MatrixIntegrationTestsfrom
copilot/fix-copilot-issues

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown

Firefox's Blazor WASM runtime keeps persistent background connections open, so WaitForLoadStateAsync(LoadState.NetworkIdle) never resolves — the previous 90 s timeout increase just delayed the inevitable failure.

Changes

  • PageExtensions.cs — new WaitForEditorLoadedAsync() helper: waits for LoadState.Load then polls for div[role="code"] visibility (Monaco rendering is a reliable Blazor-initialized signal)
  • EditorTests.cs — all WaitForLoadStateAsync(NetworkIdle) calls replaced with WaitForEditorLoadedAsync()
  • WasmRunnerTests.cs — replaced NetworkIdle + IsHiddenAsync() with Load + WaitFor(Attached) on the wasmRunner-sentinel element (sentinel is appended by JS only after WASM initializes)
  • TryDotNetJsIntegrationTests.cs — replaced NetworkIdle with Load (subsequent FindEditor() already waits for the editor element)
// Before — times out on Firefox (network never idles)
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);

// After — Load is guaranteed, then wait for the actual ready signal
await page.WaitForEditorLoadedAsync();
// which does:
//   await page.WaitForLoadStateAsync(LoadState.Load);
//   await page.Locator(@"div[role=""code""]").WaitForAsync(new LocatorWaitForOptions
//   {
//       State = WaitForSelectorState.Visible,
//       Timeout = 90_000f
//   });

…tion tests

Firefox's Blazor WASM runtime keeps background connections open, preventing
WaitForLoadStateAsync(NetworkIdle) from ever resolving within the 90-second
timeout. Replace it with the reliable WaitForLoadStateAsync(Load) paired
with an explicit element-level wait that confirms the page is truly interactive:

- EditorTests: new WaitForEditorLoadedAsync() helper waits for Load then
  for div[role="code"] to be visible (Monaco editor present = Blazor running)
- WasmRunnerTests: Load + WaitFor(Attached) on wasmRunner-sentinel element
- TryDotNetJsIntegrationTests: Load only (FindEditor() already waits for
  the editor element afterward)

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues found with Copilot fix: replace NetworkIdle with Load + explicit element wait to fix Firefox integration test timeouts Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants