Skip to content

Commit 7983efe

Browse files
committed
Stabilize first routed page bootstrap on CI
1 parent 5db317c commit 7983efe

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

full-suite-stabilization.plan.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ Tracked failing tests from the current baseline:
185185
Fix path:
186186
- switch shared route open and blank-page bounce navigation in `BrowserRouteDriver` from `NetworkIdle` to `Load`
187187
- continue treating route readiness as an explicit contract enforced by URL and `data-test` sentinels rather than by global network quiescence
188+
- [x] `Release Pipeline` run `24221016454` still fails remotely in `Shell`, `Studio`, and `Reader` after commit `5db317c`
189+
Symptom:
190+
- `Shell`, `Studio`, and `Reader` now fail inside `BrowserRouteDriver.IsPageVisibleAsync(...)` while waiting for first routed sentinels such as `library-page`, `settings-page`, and `teleprompter-page`
191+
- remote Playwright screenshots show the routed UI fully rendered by the time failure artifacts are captured, which means the page is starting successfully but missing the existing readiness budget
192+
Root cause:
193+
- the remaining problem is the first routed boot from a freshly primed `/_test/blank` page in a brand-new isolated browser context
194+
- CI macOS runners can need materially longer than the standard `15s` visible timeout for that first WebAssembly route to finish rendering even though later in-context route transitions are fast
195+
- the CI-only blank bounce retry was not helping this case because it can interrupt or restart the very first route bootstrap instead of letting the initial boot finish
196+
Fix path:
197+
- detect when `BrowserRouteDriver` is opening the first routed page from the primed blank test page
198+
- give only that first routed bootstrap the longer runtime-warmup visibility budget and skip the CI blank bounce for that specific path
199+
- keep the shorter route-visible contract for already-booted routed pages so normal suite latency does not drift upward
188200

189201
## Ordered Plan
190202

@@ -247,3 +259,10 @@ Tracked failing tests from the current baseline:
247259
- `dotnet build ./PrompterOne.slnx -warnaserror` passed
248260
- `dotnet test @./tests/dotnet-test-progress.rsp --project ./tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj` passed with `38/38`
249261
- `dotnet test @./tests/dotnet-test-progress.rsp --solution ./PrompterOne.slnx --max-parallel-test-modules 1` passed with `1162/1162` green in `7m 50.591s`
262+
- [x] Follow-up local verification after the first-route primed-blank bootstrap change
263+
Result:
264+
- `dotnet format ./PrompterOne.slnx` passed
265+
- `dotnet build ./PrompterOne.slnx -warnaserror` passed
266+
- `dotnet test @./tests/dotnet-test-progress.rsp --project ./tests/PrompterOne.Web.UITests.Shell/PrompterOne.Web.UITests.Shell.csproj` passed with `51/51`
267+
- `dotnet test @./tests/dotnet-test-progress.rsp --project ./tests/PrompterOne.Web.UITests.Studio/PrompterOne.Web.UITests.Studio.csproj` passed with `38/38`
268+
- `dotnet test @./tests/dotnet-test-progress.rsp --solution ./PrompterOne.slnx --max-parallel-test-modules 1` passed with `1162/1162` green in `7m 47.310s`

tests/PrompterOne.Web.UITests/Support/BrowserRouteDriver.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ internal static async Task OpenPageAsync(
1717
string pageTestId,
1818
string? failureLabel = null)
1919
{
20+
var bootstrappingFromPrimedBlankPage = IsCurrentRoute(page, UiTestHostConstants.BlankPagePath);
21+
var routeVisibleTimeoutMs = bootstrappingFromPrimedBlankPage
22+
? BrowserTestConstants.Timing.RuntimeWarmupVisibleTimeoutMs
23+
: BrowserTestConstants.Timing.ExtendedVisibleTimeoutMs;
24+
2025
if (await IsCurrentRouteReadyAsync(page, route, pageTestId))
2126
{
2227
return;
@@ -28,20 +33,20 @@ internal static async Task OpenPageAsync(
2833
// NetworkIdle is too strict for pages that keep long-lived browser activity alive on CI.
2934
await page.GotoAsync(route, new() { WaitUntil = RouteNavigationReadyState });
3035
await WaitForRouteAsync(page, route);
31-
if (await IsPageVisibleAsync(page, pageTestId, BrowserTestConstants.Timing.ExtendedVisibleTimeoutMs))
36+
if (await IsPageVisibleAsync(page, pageTestId, routeVisibleTimeoutMs))
3237
{
3338
return;
3439
}
3540

36-
if (attempt < RouteBootstrapAttemptCount && TestEnvironment.IsCiEnvironment)
41+
if (attempt < RouteBootstrapAttemptCount && TestEnvironment.IsCiEnvironment && !bootstrappingFromPrimedBlankPage)
3742
{
3843
await page.GotoAsync(UiTestHostConstants.BlankPagePath, new() { WaitUntil = RouteNavigationReadyState });
3944
}
4045
}
4146

4247
await TryCaptureFailurePageAsync(page, failureLabel ?? $"{RouteFailurePrefix}-{pageTestId}");
4348
await Expect(page.GetByTestId(pageTestId)).ToBeVisibleAsync(
44-
new() { Timeout = BrowserTestConstants.Timing.ExtendedVisibleTimeoutMs });
49+
new() { Timeout = routeVisibleTimeoutMs });
4550
}
4651

4752
internal static Task WaitForRouteAsync(IPage page, string route)

0 commit comments

Comments
 (0)