mxc icon indicating copy to clipboard operation
mxc copied to clipboard

[IsolationSession] The concurrent one-shot test moves on while a timed-out session is still running

Open adpa-ms opened this issue 2 weeks ago • 1 comments

Relevant area(s)

Windows

Brief description of your issue

The concurrent one-shot test in tests/scripts/run_isolation_session_tests.ps1 waits 60 s for each session to exit after its release line or ABORT. When that wait times out, Wait-SessionExit kills the session's cmd.exe but leaves its wxc-exec running, because killing wxc-exec would skip the teardown that removes the session's agent account. The test then reports the session as timed out and moves on while the session is still running.

Steps to reproduce

Read from the code at 79099c61; not run.

  1. Start-HeldSession starts each of sessions A, B and C as a cmd.exe that runs wxc-exec, and the test waits on that cmd.exe.
  2. Wait-SessionExit waits $concurrentExitWaitSec (60 s) for the cmd.exe. On timeout it kills the cmd.exe and returns, leaving its child wxc-exec running.
  3. The test records the session as "still running 60 s after its release", or "still running 60 s after ABORT" in its finally block, and goes on to session D, which its comment describes as "a session started after A, B and C have ended".
  4. The orphaned wxc-exec keeps running until the workload exits or its process.timeout (180000 ms in tests/configs/isolation_session_concurrent_{A,B,C}.json) ends it. Only then does it stop the session and remove its agent account (stop_session and deprovision_agent_user in src/mxc-sdk/src/backends/isolation_session/common/one_shot.rs).

Expected behavior

A failing run of the concurrent test ends every session it started before the suite moves on.

Actual behavior

Session D and the rest of the suite run beside the timed-out session's wxc-exec, which keeps the session and its agent account until its teardown completes. An account check made before then finds the agent account still on the host.

adpa-ms avatar Nov 16 '26 23:11 adpa-ms

[AgentAssisted] A possible fix: before session D, wait for each session's wxc-exec, the child of the cmd.exe the test started. Bound the wait by its process.timeout plus a margin for teardown, and fail a session whose wxc-exec is still running at that bound.

adpa-ms avatar Nov 16 '26 23:11 adpa-ms