1.8: vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check (#4082) - #4128
Merged
Steven Malis (smalis-msft) merged 1 commit intoAug 4, 2026
Conversation
…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)
Steven Malis (smalis-msft)
enabled auto-merge (squash)
July 31, 2026 17:20
Contributor
There was a problem hiding this comment.
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/ttyS1to avoid getty/vhangup interference. - Capture “before” and “after”
/proc/interruptssnapshots within a single shell invocation that keeps the port open, ensuring thettyS1IRQ line is present in both snapshots. - Add
set -eto ensure any failed serial writes in the loop are surfaced immediately (not silently ignored due to shellforloop exit status semantics).
Matt LaFayette (Kurjanowicz) (mattkur)
approved these changes
Aug 4, 2026
Steven Malis (smalis-msft)
merged commit Aug 4, 2026
8d2e2b2
into
microsoft:release/1.8.2607
124 of 126 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #4082 to
release/1.8.2607.The cherry-pick of e8bfd54 applied cleanly onto
release/1.8.2607with 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).