Skip to content

[IsolationSession] Drive the concurrent one-shot test over stdin - #1766

Merged
adpa-ms merged 1 commit into
mainfrom
user/adibpa/copilot-iso-concurrent-oneshot
Nov 14, 2026
Merged

adpa-ms merged 1 commit into
mainfrom
user/adibpa/copilot-iso-concurrent-oneshot

Conversation

@adpa-ms

@adpa-ms adpa-ms commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

The concurrent one-shot test in tests/scripts/run_isolation_session_tests.ps1 took its evidence from markers each session's workload appended to a shared host folder. Those writes sometimes failed with Stream was not readable. while the workload carried on and exited 0, so the test reported a session cut short that had run to completion. It also never checked that the sessions overlapped.

The test now holds each session on stdin, as the Rust test concurrent_one_shot_runs_stay_isolated does. Each workload prints X-started, waits in set /p for a line, and echoes it back. The harness starts A, B and C in turn, then releases B, A and C, waiting for each wxc-exec to exit before the next release. wxc-exec exits only after its session's teardown, so each later session is shown to run through every earlier session's teardown. No session writes a file.

On any failure the harness sends ABORT to every session still held, so each one ends and tears down normally. The test does not detect a failed teardown; an agent account left behind fails the account checks around the isolation-session suites.

🔗 References

Fixes #1650

🔍 Validation

  • Windows VM with isolation sessions (build 26100.9711): run_isolation_session_tests.ps1 passed 10 of 10 runs under Windows PowerShell and 10 of 10 under PowerShell 7. The other isolation-session suites and the interactive scenarios passed once. No run leaked an account.
  • Seven mutations, each run once on the VM, failed only their target check, within the time limits: a wrong echoed token, no set /p, exit 1, a missing start marker, a session still running after its release, a 1-second start wait, and B's release line also delivered to A.
  • Validation.Tests.Scheduled.yml: the reworked test passed in all four isolation-session jobs, on x64 and arm64.
  • Windows x64 host: local runs of the required x64 checks passed, including the live isolation-session Rust tests.

✅ Checklist

📋 Issue Type

  • Bug fix
Microsoft Reviewers: Open in CodeFlow

@adpa-ms
adpa-ms requested a review from a team as a code owner November 13, 2026 19:57
Copilot AI balanced review requested due to automatic review settings November 13, 2026 19:57
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The isolation test can accept failed teardown or a stale release response, and it can continue while a timed-out executor is still running.

3 open issues
What changed in this PR

This PR addresses #1650 by replacing unreliable workload-written log files with stdin-controlled coordination in MXC’s Windows isolation-session concurrency test.

Changes:

  • Start sessions A, B, and C sequentially, then release them in B–A–C order to exercise overlapping lifetimes and teardown.
  • Validate captured start/release markers and exit codes, with ABORT handling and bounded failure diagnostics.
  • Update all three workloads to wait on stdin and use 180-second timeouts.
File Description
tests/​scripts/​run_isolation_session_tests.ps1 Replaces shared-log assertions with stdin coordination and capture-based checks.
tests/​configs/​isolation_session_concurrent_C.json Makes C wait for and echo stdin; increases its timeout.
tests/​configs/​isolation_session_concurrent_B.json Makes B wait for and echo stdin; increases its timeout.
tests/​configs/​isolation_session_concurrent_A.json Makes A wait for and echo stdin; increases its timeout.

Review effort: Balanced

@adpa-ms
adpa-ms force-pushed the user/adibpa/copilot-iso-concurrent-oneshot branch from cb8bfcf to 0b2ce00 Compare November 13, 2026 21:48
Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the stdin-based isolation-session coordination change.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

The concurrent one-shot test took its evidence from markers each
session's workload appended to a shared host folder. Those writes
sometimes failed with "Stream was not readable." while the workload
carried on and exited 0, so the test reported a session cut short when
it had run to completion. It also never checked that the sessions
overlapped.

Each workload now prints "X-started", waits in `set /p` for a line on
stdin, and echoes the line back. The harness starts A, B and C one at a
time, then releases B, A and C in turn, waiting for each wxc-exec to
exit before the next release. wxc-exec exits only after its session's
teardown, so each later session is shown to run through every earlier
session's teardown. No session writes a file, so the shared folder and
its ACL grant are gone. The agent-name lookup goes too: #1390 removed
the log line it matched.

Each session starts through Start-Process, which does not pass the
suite's stdout and stderr on to cmd.exe, so a wxc-exec left running
after a timeout cannot keep a caller reading the suite's output
waiting. Stdin comes from a named pipe with a 4096-byte output buffer:
wxc-exec reads stdin only while the workload runs, so without the
buffer a line sent to a session still provisioning or already tearing
down would wait for that step.

On any failure the harness sends ABORT to every session still held, so
each one still ends and tears down normally, and a failing session's
result carries the tail of its output. The exit code reports the
workload, not the teardown: detecting a leaked account stays with the
account check around the isolation-session suites.

Fixes #1650

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 44ff8469-1843-47ee-8b4a-1323cbba2bd0
@adpa-ms
adpa-ms force-pushed the user/adibpa/copilot-iso-concurrent-oneshot branch from 0b2ce00 to 1029844 Compare November 14, 2026 00:47
Copilot AI balanced review requested due to automatic review settings November 14, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review findings remain for the isolation-session concurrency test changes.

No open issues 🎉

Review effort: Balanced

@adpa-ms
adpa-ms merged commit 2559eef into main Nov 14, 2026
37 checks passed
@adpa-ms
adpa-ms deleted the user/adibpa/copilot-iso-concurrent-oneshot branch November 14, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IsolationSession] The concurrent one-shot test relies on log-file writes that fail without any session ending early

3 participants