Commit 86e6258
Speed up Lite tests: enable parallelization + share DuckDB in FinOpsTests
The CI test step was averaging ~7 minutes for 257 tests because xUnit's
default parallelization was implicit and slow classes (FactCollectorTests,
ScenarioTests) blocked the pipeline. Local runs of the full suite went
from sequential-feeling runs to ~2m21s with explicit parallelization
config.
Changes:
- Add Lite.Tests/xunit.runner.json with explicit parallelization settings:
parallelizeAssembly=true, parallelizeTestCollections=true,
maxParallelThreads=-1 (use all cores), parallelAlgorithm=aggressive.
CopyToOutputDirectory wired up in the csproj.
- Serialize BaselineProviderTests and AnomalyDetectorTests into a shared
collection (BaselineProviderCollection, DisableParallelization=true).
Both classes mutate the static BaselineProvider.CacheTtl field, so they
must run sequentially relative to each other; without this, parallel
runs would race on the static state.
- Convert FinOpsTests to IClassFixture<FinOpsDuckDbFixture>, sharing one
DuckDB across the class. Every seeder in TestDataSeeder.SeedFinOps*
already calls ClearTestDataAsync first, so cross-test pollution is
prevented without rewriting test code. Saves the schema-init cost on
each test (modest, but free).
This is a pilot for the IClassFixture approach. The agent's analysis flagged
that converting other classes (FactCollectorTests etc.) would require
adding ClearTestDataAsync calls to many tests, so leaving those alone for
now. Parallel execution across classes is the bigger win and is fully
covered by the runner.json settings.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 76d825f commit 86e6258
7 files changed
Lines changed: 64 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | | - | |
| 22 | + | |
25 | 23 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 24 | + | |
40 | 25 | | |
41 | 26 | | |
42 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments