Commit 2ee3825
Fix race condition in ParameterUsingWithTests causing flaky test failures (#19317)
`ParameterUsingWithTests` had a shared `static readonly ServiceBuilder`
field that parallel tests mutated concurrently via `WithMockFileSystem`,
causing intermittent `System.ArgumentException: Destination array was
not long enough`.
## Change
Convert `Services` from a shared static field to a property so each test
gets an independent `ServiceBuilder` instance:
```csharp
// Before — shared, mutable across parallel tests
private static readonly ServiceBuilder Services = new ServiceBuilder()
.WithFeatureOverrides(new(DeployCommandsEnabled: true));
// After — fresh instance per test
private static ServiceBuilder Services => new ServiceBuilder()
.WithFeatureOverrides(new(DeployCommandsEnabled: true));
```
This matches the pattern used throughout the rest of the test suite.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>1 parent 8b0e542 commit 2ee3825
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments