You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 501ebcf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/ADR/ADR-148-parallel-ci-shards.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,10 @@ Build and Tests is a set of parallel jobs driven by one checked-in manifest, `sc
17
17
-**Build:** governance and website inventory checks, the static shard partition check and `dotnet build KeyLoad.slnx --configuration Release -warnaserror`.
18
18
-**Functional operations:** four descriptive shards. Each runs one process per namespace with the assembly-pinned filter `/KeyLoad.FunctionalTests/<namespace>/*/*` and ten concurrent tests, both locally and in CI.
19
19
-**Analyzers and process recovery:** one job with filters `/KeyLoad.AnalyzerTests/*/*/*` and `/KeyLoad.ProcessRecoveryTests/*/*/*`.
20
-
-**Aspire topology:** thirteen descriptive shards containing twenty-five lanes, with one or two lanes per runner.
21
-
- A lane is its own `dotnet test` process with `--maximum-parallel-tests 1` and a 45-minute deadline, so a runner holds at most two clusters.
20
+
-**Aspire topology:** thirteen descriptive groups containing twenty-five lanes, with one lane per isolated GitHub job.
21
+
- A lane is its own `dotnet test` process with `--maximum-parallel-tests 1` and a 45-minute deadline. A runner owns one lane's cluster resources.
22
22
- Lanes are typed: one keyed shared cluster, own clusters, other keyed clusters, or one long functional gate method.
23
-
- Every lane process owns its own keyed shared cluster, so a test that kills, restarts or cold-reopens nodes cannot affect another lane.
23
+
- Every lane has its own runner's network namespace. Aspire allocates every endpoint automatically; a different lane cannot claim an endpoint temporarily released by a killed server. Local whole-group execution joins each lane before starting the next.
24
24
-**Verify test partition:** reads every shard's TRX artifact and proves that each test ran exactly once, in its assigned shard and lane.
25
25
26
26
Each test job builds the whole solution with `-warnaserror` in Release and uploads its TRX reports even when tests fail. A single-project build is not enough: unit CodeQuality checks read the compiled image of every solution project, and the cold bootstrap topology test launches the KeyLoad CLI, which no test project references. The Release workflow calls Build and Tests through `workflow_call` and gates every publishing job on it.
@@ -38,7 +38,7 @@ Partition correctness is checked twice:
38
38
## Consequences
39
39
40
40
- Original Linux reports from run 40543129654 inform whole-class balancing across the existing lanes. Every class retains its complete methods and arguments, lane isolation kind and real fixture lifetime. Browser classes retain their browser-enabled runner. Case durations exclude build, queue, shared fixture startup and teardown; speedup remains unqualified until the changed partition completes on Linux.
41
-
- The matrix permits thirteen cluster jobs with twenty-five concurrent serial lanes, plus four functional jobs with ten concurrent tests each and one analyzers-and-process-recovery job. Build and planning are separate jobs; the final partition check waits for test results. Actual concurrency also depends on available GitHub runner capacity.
41
+
- The matrix contains twenty-five cluster jobs, plus four functional jobs with ten concurrent tests each and one analyzers-and-process-recovery job. Build and planning are separate jobs; the final partition check waits for test results. Actual concurrency also depends on available GitHub runner capacity.
42
42
- Adding a test class is a one-line manifest change. `inventory <suite>` shows the cluster each class uses and whether it disrupts nodes. A class missing from the manifest fails Build.
43
-
-Product behaviour and test assertions are unchanged. No product request or admission limit is added; the bound is on concurrent test processes per runner.
43
+
-The original test class assignments, case arguments, filters and deadlines are retained. One runner executes one cluster lane. This costs more GitHub jobs and isolates the automatic endpoint ownership of independent AppHosts, including during cold restarts.
44
44
- Static source scanning is not runtime proof. Discovery, the TRX identities and the topology lanes are qualified only by actual Linux GitHub runs.
Copy file name to clipboardExpand all lines: docs/Features/TestInfrastructure.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,8 @@ Real process-recovery scenarios live directly in `KeyLoad.ProcessRecoveryTests`,
45
45
46
46
Partial-start cleanup: every Build, image check, Start, profile or readiness failure disposes everything the fixture acquired, preserving the original failure alongside cleanup failures, and deletes only the fixture's owned data directory. Arguments are individual process arguments, never shell text; paths and filters are bounded to 4096 characters without NUL characters, and optional filters are development selection, never a complete qualification claim. Required CI suites set `KeyLoadTests:ReportTrx=true`; an omitted report setting cannot qualify original TRX retention.
47
47
48
+
Cold restarts validate the completed kill and start-acceptance phases before advancing. A replacement-health failure terminates readiness processing with its original cause. `ColdPhaseFailureClusterTests` exercises a real failed kill phase, verifies that it starts no replacements, then explicitly restores the killed processes and checks the original document and commit receipt.
49
+
48
50
Canonical source: `scripts/Features/TestInfrastructure/run-tests.mjs` selects the closed TUnit suite. IntegrationTests owns the real Aspire AppHost lifecycle through `TUnit.Aspire` and retains process readiness, abrupt-fault and joined-cleanup evidence.
| Named functional operation groups | the namespaces listed for the shard | one process per namespace selected by its descriptive group ID, `/KeyLoad.FunctionalTests/<namespace>/*/*`, `--maximum-parallel-tests 10` on local and CI runners |
156
158
| Analyzers and process recovery | compiler analyzers, then process crash recovery |`/KeyLoad.AnalyzerTests/*/*/*` and `/KeyLoad.ProcessRecoveryTests/*/*/*`|
157
-
| Named cluster capability groups | one or two lanes per runner | each lane is its own `dotnet test` process, `--maximum-parallel-tests 1 --timeout 45m`, class or method alternation under `/KeyLoad.ClusterTests/*/`|
159
+
| Named cluster capability groups | one lane per isolated GitHub runner | each lane is its own `dotnet test` process, `--maximum-parallel-tests 1 --timeout 45m`, class or method alternation under `/KeyLoad.ClusterTests/*/`|
158
160
| Verify test partition | every shard's TRX artifact |`ci-test-shards.mjs verify TestResults`|
159
161
160
162
Every test job runs `dotnet build KeyLoad.slnx --configuration Release -warnaserror`, because tests read compiled outputs of projects their test project does not reference: ProductionSourceManifestOperationTests reads the image of every solution project, and ColdBootstrapSdkTests launches the CLI from the selected configuration. Local development uses the SDK default Debug configuration. Each job writes original TRX reports below its test assembly's `bin/Release/net10.0/ci-results/<suite>/<shard>/<lane or namespace>` and uploads them even when tests fail. The filters pin the assembly segment, so process recovery tests registered by the functional host run only in the process crash recovery shard.
161
163
162
-
The manifest balances whole test classes across thirteen cluster jobs and twenty-five lanes using original Linux case durations. Lane isolation kinds and the two-cluster bound stay explicit; browser classes retain their browser-enabled runner. Additional jobs can wait for runner capacity, so this layout balances the existing lanes instead of depending on twenty cluster jobs being admitted together. Actual wall time requires a complete Linux run of this partition.
164
+
The manifest balances whole test classes across thirteen descriptive groups and twenty-five lanes using original Linux case durations. CI expands each lane into its own isolated job; lane filters, arguments and result directories retain their original identities. Additional jobs can wait for runner capacity. Actual wall time requires a complete Linux run of this partition.
163
165
164
-
A lane runs one test at a time, so it holds at most one 3-node cluster at a time and a 4-vCPU runner holds two. Lane kinds keep that bound: `shared-readers` and `shared-exclusive` lanes use one keyed shared cluster and create no clusters of their own; `own-clusters` and `functional-gate` lanes use no shared key; `isolated-clusters` lanes hold the other keyed clusters and tests without a cluster. Each lane process has its own keyed shared cluster, so a test that kills or restarts nodes affects only its own lane. Playwright is installed only on the shards that the manifest marks `playwright`.
166
+
A lane runs one test at a time. Lane kinds keep resource ownership explicit: `shared-readers` and `shared-exclusive` lanes use one keyed shared cluster and create no clusters of their own; `own-clusters` and `functional-gate` lanes use no shared key; `isolated-clusters` lanes hold the other keyed clusters and tests without a cluster. Aspire allocates all ports automatically inside that lane's isolated runner. A sibling AppHost cannot claim a port while its server is deliberately killed. Local whole-group execution joins each lane before starting the next. Playwright is installed only on the groups the manifest marks `playwright`.
165
167
166
168
The official MCP test client pins the requested protocol revision. Discovery uses the SDK's existing overall initialization timeout and the original caller token. The separate short detection probe is disabled through `DiscoverProbeTimeout = Timeout.InfiniteTimeSpan`, so a slow discovery response during a real silo fault is governed by that existing initialization budget. Protocol validation and the complete SDK/MCP result assertions remain required.
167
169
168
170
| Requirement | Acceptance and evidence |
169
171
|---|---|
170
172
| REQ-TEST-SHARD-001: every test class of the analyzer, unit, recovery and Aspire topology projects runs in exactly one shard or lane. | AC-TEST-SHARD-001: `verify` (run by Build) rejects a namespace or class in no shard, a class or method listed twice, a listed class or method absent from the source, a non-unique class name (filters match case-insensitively), an excluded `HeavyLoad` class in a lane and a split class with an unassigned method. |
171
-
| REQ-TEST-SHARD-002: a runner holds at most two concurrent clusters. | AC-TEST-SHARD-002: `verify` rejects more than `lanesPerRunner` lanes in a shard, a shared lane with several keys or own clusters, an own-cluster lane with a shared key, and a lane that runs several tests at once while it contains disruptive or own-cluster classes. |
173
+
| REQ-TEST-SHARD-002: independent cluster lanes have isolated runner networks. | AC-TEST-SHARD-002: the matrix assigns every lane to exactly one job, selected lane execution refuses unknown IDs before resources, and local whole-group runs join lanes sequentially. `verify` rejects a shared lane with several keys or own clusters, an own-cluster lane with a shared key, and a lane that runs several tests at once while it contains disruptive or own-cluster classes. |
172
174
| REQ-TEST-SHARD-003: the executed reports prove the partition. | AC-TEST-SHARD-003: `verify TestResults` (run by Verify test partition) rejects a test identity in more than one report, an inventory class or split method that never ran, a class that ran in a suite it does not belong to, a class that ran outside its shard or lane, and a suite without reports. |
173
175
174
176
Add a new test class by naming it in one lane or by placing it in a listed namespace; `inventory <suite>` prints the cluster each class uses, whether it stops, kills or restarts nodes, and its current lane.
Copy file name to clipboardExpand all lines: scripts/Features/TestInfrastructure/ci-test-partition.mjs
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,6 @@ function assignLanes(suiteId, suite, errors) {
67
67
constclassOwners=newMap();
68
68
constmethodOwners=newMap();
69
69
for(constshardofsuite.shards){
70
-
if(shard.lanes.length>suite.lanesPerRunner)errors.push(`${suiteId}: shard ${shard.id} has ${shard.lanes.length} lanes; at most ${suite.lanesPerRunner} cluster lanes fit one runner.`);
71
70
constlaneIds=newSet();
72
71
for(constlaneofshard.lanes){
73
72
if(laneIds.has(lane.id))errors.push(`${suiteId}: shard ${shard.id} repeats lane ${lane.id}.`);
Copy file name to clipboardExpand all lines: scripts/Features/TestInfrastructure/ci-test-shards.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
{
2
-
"description": "Self-descriptive Build and Tests execution groups. Functional tests run one assembly-pinned TUnit process per namespace; cluster groups run concurrent serial lanes with at most lanesPerRunner clusters per runner. Every test class belongs to exactly one descriptive execution group; verification rejects missing, overlapping or opaque group/lane names.",
2
+
"description": "Self-descriptive Build and Tests execution groups. Functional tests run one assembly-pinned TUnit process per namespace; each cluster lane runs in its own isolated GitHub job. Local whole-group execution joins lanes sequentially. Every test class belongs to exactly one descriptive execution group; verification rejects missing, overlapping or opaque group/lane names.",
0 commit comments