@@ -9,17 +9,25 @@ parameters:
99 - name : AgentPool
1010 type : object
1111 - name : simulateCrashForTesting
12+ type : boolean
13+ default : false
14+ # When true, drops a sentinel file that RNTesterApp-Fabric reads on startup
15+ # and uses to trigger a deliberate access violation. Used to validate that
16+ # the crash-dump collection path (in-process minidump writer + artifact
17+ # publish) actually produces a usable .dmp in CI. Already validated on this
18+ # branch — leaving the mechanism in place but disabled by default.
19+ - name : simulateHangForTesting
1220 # !!! TEMPORARY DEFAULT: true !!!
1321 # This branch (PR/0.84-fix-e2e-test-flakiness) flips the default to true so
14- # that PR validation actually exercises the crash -dump-collection path end
15- # to end. MUST be flipped back to false before merging anywhere — with it
16- # enabled the E2E app crashes on startup and no real tests run .
22+ # that PR validation exercises the hang -dump capture path end to end.
23+ # MUST be flipped back to false before merging anywhere — with it enabled
24+ # the E2E app deliberately hangs and the test step always fails .
1725 type : boolean
1826 default : true
19- # When true, drops a sentinel file that RNTesterApp-Fabric reads on startup
20- # and uses to trigger a deliberate access violation. Used to validate that
21- # the crash-dump collection path (WER LocalDumps + artifact publish)
22- # actually produces a usable .dmp in CI .
27+ # When true, sets the env var RNW_SIMULATE_HANG=1 on the `yarn e2etest`
28+ # step. The HangSimulationTest test then invokes the `HangForTesting`
29+ # automation command, which jams the app's UI thread; the post-failure
30+ # ProcDump step captures a full dump of the still-alive hung process .
2331 - name : buildMatrix
2432 type : object
2533 default :
@@ -109,6 +117,16 @@ jobs:
109117 }
110118 displayName: Arm crash-simulation sentinel (TEST ONLY)
111119
120+ # Test-only: arm the hang-simulation env var, which switches on
121+ # the HangSimulationTest.test.ts test. That test invokes the
122+ # `HangForTesting` automation command, jamming the app's UI thread
123+ # so the post-failure ProcDump path captures a hang dump.
124+ - ${{ if eq(parameters.simulateHangForTesting, true) }} :
125+ - pwsh : |
126+ Write-Host "##vso[task.setvariable variable=RNW_SIMULATE_HANG]1"
127+ Write-Host "Hang simulation armed (RNW_SIMULATE_HANG=1)"
128+ displayName: Arm hang-simulation env var (TEST ONLY)
129+
112130 # Test-only: directly launch the built exe (bypassing WinAppDriver
113131 # and the packaged-app activation path) with the flag armed, so we
114132 # can isolate whether WER writes a dump at all. If this produces a
@@ -144,12 +162,14 @@ jobs:
144162 displayName: yarn e2etest
145163 workingDirectory: packages/e2e-test-app-fabric
146164 # Time to wait for this task to complete before the server kills it.
147- # When simulateCrashForTesting=true the app crashes immediately on startup, so a
148- # 10-minute wait is just dead time. Drop to 2 min during simulation. REVERT this
149- # to a single `timeoutInMinutes: 10` when removing the simulation parameter.
150- ${{ if eq(parameters.simulateCrashForTesting, true) }}:
165+ # When EITHER simulation is on the test step is guaranteed to fail (crash
166+ # exits the app immediately; hang jams the UI thread). The ADO step timeout
167+ # is then the primary cutoff that lets the post-failure capture step run, so
168+ # 2 minutes is plenty. REVERT this whole conditional block to a single line
169+ # `timeoutInMinutes: 10` when removing both simulation parameters.
170+ ${{ if or(eq(parameters.simulateCrashForTesting, true), eq(parameters.simulateHangForTesting, true)) }}:
151171 timeoutInMinutes: 2
152- ${{ if not(eq(parameters.simulateCrashForTesting, true)) }}:
172+ ${{ if and( not(eq(parameters.simulateCrashForTesting, true)), not(eq(parameters.simulateHangForTesting, true) )) }}:
153173 timeoutInMinutes: 10
154174
155175 # Always disarm the crash sentinel so it cannot leak to a rerun on
0 commit comments