test(secrets): serialize env-var-mutating test classes into one xunit collection
Environment.SetEnvironmentVariable/GetEnvironmentVariable mutate the process-wide environ; concurrent setenv/getenv across parallel xunit test classes is a documented crash/flake source on glibc even with unique variable names. Group the six classes that touch process env vars into a DisableParallelization=true collection so they run serially against each other while everything else keeps running in parallel.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
namespace ZB.MOM.WW.Secrets.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Serializes every test class that mutates process environment variables. setenv/getenv operate
|
||||
/// on the single process-wide environ, which is not safe under concurrent mutation on glibc —
|
||||
/// unique variable names do not remove the race, only serialization does. Classes that never
|
||||
/// touch the environment stay fully parallel.
|
||||
/// </summary>
|
||||
[CollectionDefinition("Process environment", DisableParallelization = true)]
|
||||
public sealed class ProcessEnvironmentCollection;
|
||||
Reference in New Issue
Block a user