test: improve flaky usb reconnection test#2332
Open
yaroslavborbat wants to merge 1 commit intomainfrom
Open
Conversation
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
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.
Description
Refactor the flaky USB reconnection e2e test to improve reliability.
The monolithic
mountUSB()function was split into three focused steps:findUSBMountDevice()— locates the block device path via/sys/bus/usb/deviceswith retriesformatUSBDevice(mountDevice)— formats the device withmkfs.vfatbefore the first mount to ensure a clean filesystemmountUSBDevice(mountDevice)— mounts the located device directly by path (no multi-fallbackmount -t auto)Additional diagnostic
GinkgoWriter.Printlncalls were added at key steps, andLongTimeoutis now used for the mount step to handle slow environments.Why do we need it, and what problem does it solve?
The USB reconnection test was flaky because:
-t auto,-t vfat, no flag), masking root causes.Splitting the steps, adding an explicit
mkfs.vfatformat, and increasing the mount timeout makes the test deterministic and easier to debug when it does fail.What is the expected result?
VirtualMachineUSBe2e suite.GinkgoWriteroutput clearly shows which step (find / format / mount) failed.Checklist
Changelog entries