[IsolationSession] The concurrent one-shot test moves on while a timed-out session is still running
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.
Start-HeldSessionstarts each of sessions A, B and C as acmd.exethat runswxc-exec, and the test waits on thatcmd.exe.Wait-SessionExitwaits$concurrentExitWaitSec(60 s) for thecmd.exe. On timeout it kills thecmd.exeand returns, leaving its childwxc-execrunning.- The test records the session as "still running 60 s after its release", or "still running 60 s after ABORT" in its
finallyblock, and goes on to session D, which its comment describes as "a session started after A, B and C have ended". - The orphaned
wxc-execkeeps running until the workload exits or itsprocess.timeout(180000 ms intests/configs/isolation_session_concurrent_{A,B,C}.json) ends it. Only then does it stop the session and remove its agent account (stop_sessionanddeprovision_agent_userinsrc/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.
[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.