Summary
ProgramRunnerTests.RunInstallerProcess_CancelsHungInstaller can fail under parallel test load because the 100 ms cancellation may kill the shell after redirection creates installer.pid but before echo $$ writes the PID. The test checks only that the file exists and then parses its contents, so it can observe an empty string.
Observed failure:
System.FormatException: The input string '' was not in a correct format.
at System.Int32.Parse(...)
at CodeIndex.Tests.ProgramRunnerTests.RunInstallerProcess_CancelsHungInstaller()
Reproduction
The failure occurred while running a broader filtered Release net8.0 group (859 tests):
dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --no-build --no-restore -f net8.0 -p:UseSharedCompilation=false --filter "FullyQualifiedName~Issue4738|FullyQualifiedName~ConsoleUiTests|FullyQualifiedName~ProgramCliTests|FullyQualifiedName~ProgramRunnerTests"
The test passed immediately when rerun in isolation.
Expected
The test should wait for the PID file to contain a complete integer before cancellation, or use a readiness handshake before starting the cancellation window.
Summary
ProgramRunnerTests.RunInstallerProcess_CancelsHungInstallercan fail under parallel test load because the 100 ms cancellation may kill the shell after redirection createsinstaller.pidbut beforeecho $$writes the PID. The test checks only that the file exists and then parses its contents, so it can observe an empty string.Observed failure:
Reproduction
The failure occurred while running a broader filtered Release net8.0 group (859 tests):
The test passed immediately when rerun in isolation.
Expected
The test should wait for the PID file to contain a complete integer before cancellation, or use a readiness handshake before starting the cancellation window.