You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A WhatIf test times out in the emulated x86 host on the ARM64 runner #98
One test of Tests/Unit/Module.WhatIf.Tests.ps1 fails now and then in the Windows on ARM job of quality-gates.yml. It runs a script in the 32-bit host with a timeout of 60 seconds, and on the ARM64 runner that host is emulated: the run sometimes takes longer than the timeout, comes back as timed out, and the test fails on the exit code.
Findings
The test is "does not ask again inside a run the caller agreed to, in a session that cannot answer" (lines 228 to 247 on main). It calls Invoke-IslScriptRun with Architecture = 'x86' and -TimeoutSeconds 60, and expects exit code: 0.
An empty exit code is what a run that timed out returns, and 61 seconds is the timeout plus the cleanup. The x64 jobs and the Windows PowerShell 5.1 job passed in all six runs. The order of the files was shuffled differently in each run, and in the passing runs the file ran both before and after the other files that start processes, so the order does not explain it.
The test is about the confirm preference inside a run, not about the architecture. On Windows on ARM there is no x64 host, and x86 is emulated; the native host is arm64 there.
Proposed change
Run the script in the device's own 64-bit host (Get-IslHostArchitecture: arm64 on the ARM64 runner, x64 elsewhere), which is the host the other test of the file that really runs a script gets from Invoke-IntuneDetectionTest's default (line 49).
A third failure, and a check that it is not the branches.
Run 45314374634, attempt 2: the same test failed again in the Windows on ARM job, after 61.33 s, with exit code: .
All three failures were on branches of the fix(harness)!: raise run failures as terminating errors with IDs #92 stack, which changes the launch path, so the time the whole test file took on the ARM runner was compared. Runs of main's code: 86.82, 52.66, 47.97, 47.45 and 49.30 s, all passing. Passing runs of the stack and of fix(tests): stop a test from waiting for input at a prompt #94: 52.29, 49.90, 48.78 and 80.37 s. main's code has the slow runs too: the 86.82 s run put most of the file's time into this one x86 run and passed below the limit. The spread is the runner's.
A correction to the comment above, and a change to #99.
The failures are not shown to be the runner's spread. Two more runs failed the same way, 45482242313 on #92 and 45483093006 on #95, each after 61.1 s. Counted by the code under test, the Windows on ARM job failed on this test in 5 of 9 runs of the branches of #92, #95 and #96, and in none of about 8 runs of main's code. If the rate were the same for both, a split that uneven would come up about 2 times in 100. The passing runs take about the same time on both (the whole file 47 to 53 s, with one run of 80 s on #94 and one of 87 s on main), and the files that ran just before the test do not differ in any visible way. The cause is not known. What the comment above said, "the spread is the runner's", does not follow from these numbers.
#99 keeps the x86 host. The Windows on ARM job runs the unit suites only (./Tests/Invoke-Tests.ps1 -TestType Unit), and the other unit tests that name x86 mock the launch, so this test is the one that starts the emulated host for real on that runner. Moving it to the native host, as #99 first did, would have left that host untested there. #99 now gives the run 300 seconds, the default of the commands, in place of 60.
What that leaves open. With 300 seconds the test no longer shows whether the emulated start is slower with the changes of #92. Measuring it needs either an ARM64 device or a run that prints the run's Duration, which this job does not do today.
Measured on an ARM64 device (Windows 10.0.26200, PowerShell 7.7.0): #92 does not make the emulated x86 start slower.
The launch the test makes, Invoke-IslScriptRun -Architecture x86 under a confirm preference of Low with a script that writes a marker and exits 0, was run from fresh processes with main's code (c4bc352) and with #92's (9897016), alternating, three rounds of four:
Every run exited 0 and none timed out. The native arm64 host took 0.2 to 1.0 s on both. So the launch is about 30 times faster than the 60 s timeout on that device, the same on both trees, and the CI failures come from the hosted ARM64 runner, which is far slower or more variable for this start. The higher failure count on the stack's branches is then most likely chance, though the numbers above do not prove that either. #99's 300 s stands.
One run of the test file on that device failed for another reason: with #92's code it ended in 13 s with one failed test, where every other run of the file passed in 15 to 17 s. It did not happen again in three more runs. It is being looked into separately and does not involve the timeout.
The one failure on the ARM64 device did not come back.
Tests/Unit/Module.WhatIf.Tests.ps1 was run 30 times with #92's code (9897016) and 30 times with main's (c4bc352), in alternating batches of 15 in one process each, on the same device (Windows 10.0.26200, PowerShell 7.7.0, Pester 6.2.0). All 60 passed: about 13 s a run once the process was warm, and 15 to 16 s for the first run of each process. With the three earlier passing runs, #92's code passed 33 times after the one failure. That failure was recorded without its test name or error text, so its cause is not known; it was not the timeout, which allows 60 s for one run that takes about 2 s there.
No IntuneScriptLab-* scheduled task was registered before, during or after the runs, and the number of folders under %TEMP%\IntuneScriptLab did not change, so the runs leave nothing behind.
Nothing further is planned for it unless it shows up again.
Activity
fadwen commentedon Nov 24, 2026
A third failure, and a check that it is not the branches.
Windows on ARMjob, after 61.33 s, withexit code:.main's code: 86.82, 52.66, 47.97, 47.45 and 49.30 s, all passing. Passing runs of the stack and of fix(tests): stop a test from waiting for input at a prompt #94: 52.29, 49.90, 48.78 and 80.37 s.main's code has the slow runs too: the 86.82 s run put most of the file's time into this one x86 run and passed below the limit. The spread is the runner's.Windows on ARMjob passed in run 45474937952.Discovered and written up with Claude Code.
fadwen commentedon Nov 24, 2026
A correction to the comment above, and a change to #99.
The failures are not shown to be the runner's spread. Two more runs failed the same way, 45482242313 on #92 and 45483093006 on #95, each after 61.1 s. Counted by the code under test, the
Windows on ARMjob failed on this test in 5 of 9 runs of the branches of #92, #95 and #96, and in none of about 8 runs ofmain's code. If the rate were the same for both, a split that uneven would come up about 2 times in 100. The passing runs take about the same time on both (the whole file 47 to 53 s, with one run of 80 s on #94 and one of 87 s onmain), and the files that ran just before the test do not differ in any visible way. The cause is not known. What the comment above said, "the spread is the runner's", does not follow from these numbers.#99 keeps the x86 host. The
Windows on ARMjob runs the unit suites only (./Tests/Invoke-Tests.ps1 -TestType Unit), and the other unit tests that namex86mock the launch, so this test is the one that starts the emulated host for real on that runner. Moving it to the native host, as #99 first did, would have left that host untested there. #99 now gives the run 300 seconds, the default of the commands, in place of 60.What that leaves open. With 300 seconds the test no longer shows whether the emulated start is slower with the changes of #92. Measuring it needs either an ARM64 device or a run that prints the run's
Duration, which this job does not do today.Discovered and written up with Claude Code.
fadwen commentedon Nov 24, 2026
Measured on an ARM64 device (Windows 10.0.26200, PowerShell 7.7.0): #92 does not make the emulated x86 start slower.
The launch the test makes,
Invoke-IslScriptRun -Architecture x86under a confirm preference ofLowwith a script that writes a marker and exits 0, was run from fresh processes withmain's code (c4bc352) and with #92's (9897016), alternating, three rounds of four:mainEvery run exited 0 and none timed out. The native arm64 host took 0.2 to 1.0 s on both. So the launch is about 30 times faster than the 60 s timeout on that device, the same on both trees, and the CI failures come from the hosted ARM64 runner, which is far slower or more variable for this start. The higher failure count on the stack's branches is then most likely chance, though the numbers above do not prove that either. #99's 300 s stands.
One run of the test file on that device failed for another reason: with #92's code it ended in 13 s with one failed test, where every other run of the file passed in 15 to 17 s. It did not happen again in three more runs. It is being looked into separately and does not involve the timeout.
Discovered and written up with Claude Code.
fadwen commentedon Nov 24, 2026
The one failure on the ARM64 device did not come back.
Tests/Unit/Module.WhatIf.Tests.ps1was run 30 times with #92's code (9897016) and 30 times withmain's (c4bc352), in alternating batches of 15 in one process each, on the same device (Windows 10.0.26200, PowerShell 7.7.0, Pester 6.2.0). All 60 passed: about 13 s a run once the process was warm, and 15 to 16 s for the first run of each process. With the three earlier passing runs, #92's code passed 33 times after the one failure. That failure was recorded without its test name or error text, so its cause is not known; it was not the timeout, which allows 60 s for one run that takes about 2 s there.No
IntuneScriptLab-*scheduled task was registered before, during or after the runs, and the number of folders under%TEMP%\IntuneScriptLabdid not change, so the runs leave nothing behind.Nothing further is planned for it unless it shows up again.
Discovered and written up with Claude Code.