@@ -184,6 +184,17 @@ jobs:
184184 displayName: Disarm crash-simulation sentinel (TEST ONLY)
185185 condition: always()
186186
187+ # Always disarm the hang-simulation env var so the post-failure
188+ # `Update snapshots` step (which also runs `yarn e2etest`) does not
189+ # re-trigger the hang and burn 10 minutes of dead time. Setting an
190+ # ADO variable to empty string clears it for subsequent steps.
191+ - ${{ if eq(parameters.simulateHangForTesting, true) }} :
192+ - pwsh : |
193+ Write-Host "##vso[task.setvariable variable=RNW_SIMULATE_HANG]"
194+ Write-Host "Hang simulation disarmed (RNW_SIMULATE_HANG cleared)"
195+ displayName: Disarm hang-simulation env var (TEST ONLY)
196+ condition: always()
197+
187198 # On test failure, snapshot any lingering RNTesterApp-Fabric / node
188199 # processes before subsequent steps (or the agent) tear them down.
189200 # WER LocalDumps only fires on actual crashes; this catches hangs
@@ -202,8 +213,12 @@ jobs:
202213 $dumpPath = Join-Path "$(CrashDumpRootPath)" ("hang_{0}_{1}.dmp" -f $name, $_.Id)
203214 Write-Host "Capturing full dump of $name (pid $($_.Id)) to $dumpPath"
204215 & $procDump -accepteula -ma $_.Id $dumpPath
216+ Write-Host ("ProcDump exit code: {0} (non-zero is normal — encodes the dump count written)" -f $LASTEXITCODE)
205217 }
206218 }
219+ # ProcDump uses non-zero exit codes to encode the number of dumps written.
220+ # Force a clean PowerShell exit so the step doesn't show as a warning.
221+ exit 0
207222 displayName: Capture dumps of surviving test processes
208223 condition: and(failed(), eq(variables.StartedFabricTests, 'true'))
209224 continueOnError: true
0 commit comments