Skip to content

Fix fixture compile-log sharing races - #836

Merged
coneilen merged 1 commit into
mainfrom
coneilen-fix-fixture-compile-log-sharing-race
Oct 16, 2026
Merged

coneilen merged 1 commit into
mainfrom
coneilen-fix-fixture-compile-log-sharing-race

Conversation

@coneilen

@coneilen coneilen commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Make the Windows capture-test fixtures read compiler logs while inherited telemetry writers may still hold them open. Preserve the actual compile exit code and hash provenance from the same bytes read.

Changes

  • Added a fixture-local share-tolerant log snapshot reader and used it for stdout/stderr in both harmless compiler fixtures.
  • Reused the same stdout/stderr snapshots for the harmless-target provenance hashes; no production/runtime code or semantic test cases changed.

Test plan

The RED and GREEN checks were the isolated held-writer harnesses. The regression command ran the full direct Windows fixture suite; macOS make test and make check were not run.

RED: if(Test-Path -LiteralPath 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-launch-temp-r2'){throw 'Fresh launch TEMP already exists; stop'}; $null=[IO.Directory]::CreateDirectory('C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-launch-temp-r2'); $env:TEMP='C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-launch-temp-r2'; $env:TMP=$env:TEMP; pwsh -NoProfile -File 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-HeldWriterRepro.ps1' -Mode Red -Root 'C:\gc833-f9b20c-r2' -TempRoot 'C:\Users\coneilen\AppData\Local\Temp\gc833-f9b20c-r2' *>&1 | Out-File -FilePath 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-Red2-console.txt' -NoClobber -Encoding utf8; $reproExit=$LASTEXITCODE; Write-Output ("ISSUE833_RED_PROCESS_EXIT={0}" -f $reproExit); if($reproExit -ne 0){exit $reproExit} -> result.json status=RED, executed=1, passed=0, failed=1; ReadAllText HRESULT 0x80070020 while writer held; harness exit marker 0 after recording intended behavioral RED
GREEN: if(Test-Path -LiteralPath 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-launch-temp-g1'){throw 'Fresh launch TEMP already exists; stop'}; $null=[IO.Directory]::CreateDirectory('C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-launch-temp-g1'); $env:TEMP='C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-launch-temp-g1'; $env:TMP=$env:TEMP; pwsh -NoProfile -File 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-BoundGreen.ps1' -SourcePath 'D:\depot\copilot-worktrees\GraphCode\coneilen-issue-833-fix-fixture-compile-log-sharing-race-f9b20c\Tools\windows\Tests\UiCaptureDriver.Tests.ps1' -ExpectedSourceSha256 'DF842491992C6571142074B2686FF40E49FA51CC360F6108D31E6209C268F0A7' -Root 'C:\gc833-f9b20c-green-1' -TempRoot 'C:\Users\coneilen\AppData\Local\Temp\gc833-f9b20c-green-1' *>&1 | Out-File -FilePath 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-Green1-console.txt' -NoClobber -Encoding utf8; $reproExit=$LASTEXITCODE; Write-Output ("ISSUE833_GREEN_PROCESS_EXIT={0}" -f $reproExit); if($reproExit -ne 0){exit $reproExit} -> source-bound helper GREEN: executed=1, passed=1, failed=0; legacy ReadAllText HRESULT 0x80070020; tracked helper text and same-byte SHA-256 matched
REGRESSION: if(Test-Path -LiteralPath 'C:\Users\coneilen\AppData\Local\Temp\gc833-f9b20c-59'){throw 'Private TEMP already exists; stop'}; if(Test-Path -LiteralPath 'C:\gc833-f9b20c-59'){throw 'Full59 root already exists; stop'}; if(Test-Path -LiteralPath 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-59-console.txt'){throw 'Full59 console already exists; stop'}; $null=[IO.Directory]::CreateDirectory('C:\Users\coneilen\AppData\Local\Temp\gc833-f9b20c-59'); $env:TEMP='C:\Users\coneilen\AppData\Local\Temp\gc833-f9b20c-59'; $env:TMP=$env:TEMP; pwsh -NoProfile -File 'D:\depot\copilot-worktrees\GraphCode\coneilen-issue-833-fix-fixture-compile-log-sharing-race-f9b20c\Tools\windows\Tests\UiCaptureDriver.Tests.ps1' -ScratchRoot 'C:\gc833-f9b20c-59' *>&1 | Out-File -FilePath 'C:\Users\coneilen.copilot\session-state\b26d36e4-9e49-4aab-b321-260853848824\files\Issue833-59-console.txt' -NoClobber -Encoding utf8; $testExit=$LASTEXITCODE; Write-Output ("ISSUE833_FULL59_PROCESS_EXIT={0}" -f $testExit); exit $testExit -> exit marker 0; UiCaptureDriver executed=59, passed=59, failed=0; report shows 59 unique case names

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally (make test)
  • Code follows the existing style (make check)
  • I added the test/contract before the implementation and observed the intended RED failure

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b26d36e4-9e49-4aab-b321-260853848824
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen

Copy link
Copy Markdown
Collaborator Author

Refs #833. The issue stays open until merge and coordinator verification. This comment is for linkage only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant