Use temp directory as TestExecutionDirectory in RunTestsOnHelix.sh #45022
+25
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I looked into using the temp directory on Unix like we do on Windows and it uncovered two issues (#3923 was an earlier report)
Helix sets
$TMPDIR
to/tmp/helix
but on macOS/tmp
is a symlink to/private/tmp
and a bunch of tests then fail since parts of the sdk see/tmp
and other parts see the resolved/private/tmp
path and checks for path equality and other similar logic fails (see also .NET SDK fails to resolve transitive references in standard macOS $TMPDIR and other symlinked directories #37687)-> this was relatively easy to solve by making sure we use the resolved path as the TestExecutionDirectory. Ideally we'd solve the underlying symlink equality issue but that's a bigger change.
the test
GivenWorkloadUpdateAcrossFeatureBandsItUpdatesPacks
started failing in CI but only on Linux. I tried reproducing it locally but it always passed. Then I stepped through it under the debugger and noticed that I got this exception here:... but we're swallowing the exception so the test accidentally passed because the workload GC was aborted.
I tracked it down to us not closing the file stream created by File.Create() during the test, once I fixed that the test now consistently failed everywhere (it asserts that the file should exist but it gets deleted during workload GC). This was fixed by mocking up a 5.0.1xx SDK install so that the installation records for that feature band won't be deleted.
We're now correctly closing all file streams created by File.Create() in the codebase.