vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check - #4082
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses intermittent failures in the PCIe IOMMU interrupt-remapping tests by eliminating a race where systemd’s serial-getty@ttyS0.service can vhangup /dev/ttyS0 during the test’s serial-write loop, causing write() to fail with EIO.
Changes:
- Stop
serial-getty@ttyS0.serviceon systemd-based Linux guests before writing to/dev/ttyS0, preventing vhangup-inducedEIOfailures mid-loop. - Make the serial-write loop fail-fast by adding
set -e, ensuring any failed iteration is surfaced instead of being silently ignored.
jstarks
reviewed
Jul 29, 2026
smalis-msft
enabled auto-merge (squash)
July 29, 2026 21:25
jstarks
approved these changes
Jul 30, 2026
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.
amd_iommu_mixed_topology / intel_vtd_multi_segment intermittently fail with sh: 1: echo: echo: I/O error.
Root cause. The test generates serial IRQs by writing to ttyS0, which is the guest console with serial-getty@ttyS0.service on it. That unit is Type=idle + 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() 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.
Fix. Use ttyS1 instead, as there's no getty attached to it.
Also adds set -e 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.