Files
dotnet-runtime/src/libraries/System.IO.FileSystem/tests/Directory
Stephen Toub 2117d05ebe Avoid file collisions with temporary test files
In some of our test suites, we use a pattern where a base class contains the core test logic and then derived classes override various members in those base classes to customize the actual tests.  xunit then runs the base methods for each of the derived types.

Since xunit by default parallelizes inter-class, meaning it won't parallelize tests on the same class but will on different classes, tests on the base class may run in parallel with themselves, though, when actually being run for different concrete derived types.  This is problematic when the tests pick temporary file names based on the test itself, e.g. using the FileCleanupTestBase helper that derives a temporary file name from the current member name, line number, etc.

To avoid such conflicts, this changes adds a random identifier into each such temporary file name.


Commit migrated from https://github.com/dotnet/corefx/commit/8c16d26d42c3aa81b28e4aeb790a821bd67c03b8
2017-05-08 13:36:32 -04:00
..
2017-02-08 15:14:15 -08:00