Skip to content

Commit e010bf6

Browse files
committed
Reduce CI browser suite contention
1 parent 20ed472 commit e010bf6

File tree

6 files changed

+9
-16
lines changed

6 files changed

+9
-16
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Browser test execution rules:
130130
- Use one `dotnet test` process at a time for the browser suite.
131131
- The browser suite self-hosts the built WASM assets on a dynamically assigned loopback HTTP origin.
132132
- Each browser-suite host startup MUST request a fresh OS-assigned loopback port via `http://127.0.0.1:0`. Never pin or reuse a fixed browser-test port across runs.
133-
- Inside that single process, the browser suite may run up to `4` parallel TUnit workers.
133+
- Inside that single process, the browser suite may run up to `4` parallel TUnit workers locally; when repeated full-suite CI runs prove resource contention, lower the CI worker cap instead of weakening browser assertions.
134134
- Do not run `PrompterOne.Web.UITests` in parallel with another `dotnet build` or `dotnet test` command.
135135
- Browser acceptance tests must stay on the production-shaped runtime path; do not add or keep `?wasm-debug=1` or similar debug-query scenarios in automated acceptance coverage unless the user explicitly asks for that path.
136136
- Do not add Python or ad-hoc runner scripts to bootstrap browser verification. The repo test commands must self-host the app and execute the flows end to end on their own.

tests/PrompterOne.Web.UITests/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
- This suite is the primary acceptance gate for the product.
3232
- Major workflows must be covered by long scenario tests, not only narrow regression tests.
3333
- Major scenario tests must save screenshots under `output/playwright/`.
34-
- This suite resolves its origin at runtime and uses one `dotnet test` process with up to `4` parallel TUnit workers.
34+
- This suite resolves its origin at runtime and uses one `dotnet test` process with up to `4` local parallel TUnit workers; lower the CI worker cap only when repeated full-suite runs prove resource contention.
3535
- Do not keep separate concurrent `dotnet build` or `dotnet test` processes alive against the same test assets.
3636
- Prefer `PrompterOne.Shared.Contracts.AppRoutes`, `UiTestIds`, and other named constants over inline route or selector strings.
3737
- Use dedicated test attributes first. Prefer `data-test-id`, allow `data-test`, and keep existing `data-testid` contracts until a deliberate migration replaces them. Raw text, role-name, and CSS selectors are allowed only when no stable dedicated test hook exists yet and the missing contract is fixed in the same task.

tests/PrompterOne.Web.UITests/GoLive/GoLiveFlowTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -686,13 +686,6 @@ private static bool HarnessHasPublishedKind(JsonElement? harnessState, string ki
686686
return false;
687687
}
688688

689-
private static string SerializeDiagnosticState(JsonElement? state)
690-
{
691-
return state.HasValue
692-
? JsonSerializer.Serialize(state.Value)
693-
: "null";
694-
}
695-
696689
private readonly record struct LayoutBounds(double X, double Y, double Width, double Height);
697690

698691
[Test]

tests/PrompterOne.Web.UITests/GoLive/GoLiveOutputFailureRollbackTests.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,12 @@ private static Task SeedLiveKitOnlyOperationalSettingsAsync(Microsoft.Playwright
132132
private static async Task WaitForRuntimeSessionClearedAsync(Microsoft.Playwright.IPage page)
133133
{
134134
var deadline = DateTimeOffset.UtcNow.AddMilliseconds(BrowserTestConstants.Timing.ExtendedVisibleTimeoutMs);
135-
JsonElement? lastRuntimeState = null;
136135

137136
while (DateTimeOffset.UtcNow < deadline)
138137
{
139-
lastRuntimeState = await page.EvaluateAsync<JsonElement?>(
140-
BrowserTestConstants.GoLive.GetRuntimeStateScript,
141-
BrowserTestConstants.GoLive.RuntimeSessionId);
142-
138+
var lastRuntimeState = await page.EvaluateAsync<JsonElement?>(
139+
BrowserTestConstants.GoLive.GetRuntimeStateScript,
140+
BrowserTestConstants.GoLive.RuntimeSessionId);
143141
if (!lastRuntimeState.HasValue)
144142
{
145143
return;

tests/PrompterOne.Web.UITests/Infrastructure/TestAssemblyConfiguration.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
namespace PrompterOne.Web.UITests;
44

5-
public sealed record UiTestParallelLimit : IParallelLimit
5+
public sealed class UiTestParallelLimit : PrompterOne.Testing.EnvironmentAwareParallelLimitBase
66
{
7-
public int Limit => UiTestParallelization.DefaultWorkerLimit;
7+
protected override int CiLimit { get; } = 2;
8+
protected override int LocalLimit { get; } = UiTestParallelization.DefaultWorkerLimit;
89
}
910

1011
internal static class UiTestParallelization

tests/PrompterOne.Web.UITests/PrompterOne.Web.UITests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<ItemGroup>
2121
<ProjectReference Include="../../src/PrompterOne.Web/PrompterOne.Web.csproj" ReferenceOutputAssembly="false" />
2222
<ProjectReference Include="../../src/PrompterOne.Shared/PrompterOne.Shared.csproj" />
23+
<ProjectReference Include="../PrompterOne.Testing/PrompterOne.Testing.csproj" />
2324
</ItemGroup>
2425

2526
</Project>

0 commit comments

Comments
 (0)