Skip to content

vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check - #4082

Merged
smalis-msft merged 3 commits into
microsoft:mainfrom
smalis-msft:fix-tty-tests
Jul 30, 2026
Merged

vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check#4082
smalis-msft merged 3 commits into
microsoft:mainfrom
smalis-msft:fix-tty-tests

Conversation

@smalis-msft

@smalis-msft smalis-msft commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.

@smalis-msft
smalis-msft requested a review from a team as a code owner July 29, 2026 18:32
Copilot AI review requested due to automatic review settings July 29, 2026 18:32
@smalis-msft smalis-msft added the backport_1.8.2607 Change should be backported to the release/1.8.2607 branch label Jul 29, 2026

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 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.service on systemd-based Linux guests before writing to /dev/ttyS0, preventing vhangup-induced EIO failures mid-loop.
  • Make the serial-write loop fail-fast by adding set -e, ensuring any failed iteration is surfaced instead of being silently ignored.

@github-actions

Copy link
Copy Markdown

Comment thread vmm_tests/vmm_tests/tests/tests/multiarch/pcie.rs Outdated
@smalis-msft smalis-msft changed the title vmm_tests: fix ttyS0 hangup race in the IOAPIC interrupt-remapping check vmm_tests: fix serial hangup race in the IOAPIC interrupt-remapping check Jul 29, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 20:59

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 29, 2026 21:07

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@smalis-msft
smalis-msft enabled auto-merge (squash) July 29, 2026 21:25
@github-actions

Copy link
Copy Markdown

@smalis-msft
smalis-msft merged commit e8bfd54 into microsoft:main Jul 30, 2026
69 checks passed
@smalis-msft
smalis-msft deleted the fix-tty-tests branch July 30, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport_1.8.2607 Change should be backported to the release/1.8.2607 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants