Skip to content

1.8: vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check (#4082) - #4128

Merged
Steven Malis (smalis-msft) merged 1 commit into
microsoft:release/1.8.2607from
smalis-msft:backport-1.8-pr4082
Aug 4, 2026
Merged

1.8: vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check (#4082)#4128
Steven Malis (smalis-msft) merged 1 commit into
microsoft:release/1.8.2607from
smalis-msft:backport-1.8-pr4082

Conversation

@smalis-msft

Copy link
Copy Markdown
Contributor

Backport of #4082 to release/1.8.2607.

The cherry-pick of e8bfd54 applied cleanly onto release/1.8.2607 with no conflicts and no manual edits.

Original PR: #4082


This backport PR was created by an AI agent (GitHub Copilot) on behalf of Steven Malis (@smalis-msft).

…heck (microsoft#4082)

[amd_iommu_mixed_topology](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
/
[intel_vtd_multi_segment](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
intermittently fail with [sh: 1: echo: echo: I/O
error](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html).

Root cause. The test generates serial IRQs by writing to
[ttyS0](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html),
which is the guest console with
[serial-getty@ttyS0.service](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
on it. That unit is
[Type=idle](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
+ TTYVHangup=yes, so agetty isn't exec'd until systemd's boot job queue
drains — and when it runs it vhangups the tty, failing any in-flight
[write()](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
with EIO. Pipette starts before boot finishes, so the test can land in
that window. In run 30466090198 the EIO hit 4 ms after [Finished
cloud-final.service](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html).

Fix. Use ttyS1 instead, as there's no getty attached to it.

Also adds [set
-e](vscode-file://vscode-app/c:/Users/stevenmalis/AppData/Local/Programs/Microsoft%20VS%20Code/e4c7e7b1d6/resources/app/out/vs/code/electron-browser/workbench/workbench.html)
to the write loop — a for loop's status is only its last iteration's, so
failed writes were being silently discarded. Only safe with the fix, as
it makes the test ~32x more sensitive.

(cherry picked from commit e8bfd54)
Copilot AI review requested due to automatic review settings July 31, 2026 17:18
@smalis-msft
Steven Malis (smalis-msft) requested a review from a team as a code owner July 31, 2026 17:18
@smalis-msft Steven Malis (smalis-msft) added the release_1.8.2607 Targets the release/1.8.2607 branch. label Jul 31, 2026
@smalis-msft
Steven Malis (smalis-msft) enabled auto-merge (squash) July 31, 2026 17:20

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.

Pull request overview

This backport updates a flaky vmm_tests check for IOAPIC interrupt remapping by avoiding guest console TTY ownership races that can cause intermittent serial write failures during boot.

Changes:

  • Switch the interrupt-remapping “generate serial IRQs” path from /dev/ttyS0 (console) to /dev/ttyS1 to avoid getty/vhangup interference.
  • Capture “before” and “after” /proc/interrupts snapshots within a single shell invocation that keeps the port open, ensuring the ttyS1 IRQ line is present in both snapshots.
  • Add set -e to ensure any failed serial writes in the loop are surfaced immediately (not silently ignored due to shell for loop exit status semantics).

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

@smalis-msft
Steven Malis (smalis-msft) merged commit 8d2e2b2 into microsoft:release/1.8.2607 Aug 4, 2026
124 of 126 checks passed
@smalis-msft
Steven Malis (smalis-msft) deleted the backport-1.8-pr4082 branch August 4, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_1.8.2607 Targets the release/1.8.2607 branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants