Skip to content

test: Drop the wall-clock bound from test_v4l2_udev_poll_error - #2199

Merged
zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:test/v4l2-udev-flake
Oct 24, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:test/v4l2-udev-flake

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2198

What and why

test_v4l2_udev_poll_error (monitor_fd_hangup_ends_loop) failed on Linux Tier 2 in run 40119239268 for #2194, which doesn't touch v4l2. The failure was elapsed < 50 is not true, even though the loop had returned and logged the expected "stopping hot-plug updates" warning. On a loaded runner the round trip took 50 ms or more of wall clock.

run_with_fd() already proves that the loop stops instead of spinning:

  • returned is true only if the loop exits on its own within the 500 × 1 ms wait;
  • run.iterations <= 2 bounds the number of polls.

This drops the wall-clock assert and the unused now_ms() helper, and adds a comment saying why. It changes the test only. A udev loop that spins on a poll error (#1280) still fails the test, through returned and the iteration bound.

RED → GREEN

  • RED commit: N/A. This removes a timing flake, and the failure only reproduces under CI load. The failing CI run (40119239268) is the evidence.
  • GREEN: 3d3593d32. The test source compiles with gcc -std=gnu11 -Wall -Wextra -Werror, and clang-format --dry-run --Werror is clean. PR CI runs it on Linux.
  • Real app (UI, protocol output or logging changes): N/A

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits (N/A for docs-only; a focused CI fix may push RED and GREEN together)
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with scripting ON (PR CI builds no OBS app: run gh workflow run ci.yml --ref <branch> for the full builds) and cross-checked with clang and MSVC
  • Intentional differences from C listed in the parity test header and rust/README.md (ports)

The test already proves the udev loop stops instead of spinning: it must
return on its own within the 500 x 1 ms wait, after at most two polls.
The extra elapsed < 50 ms check added no coverage and failed on a loaded
CI runner (run 40119239268) even though the loop had returned.

Fixes obs-rust#2198
@rdoupe
rdoupe requested a review from zackees as a code owner October 24, 2026 18:29
@zackees
zackees added this pull request to the merge queue Oct 24, 2026
Merged via the queue into obs-rust:master with commit cf16fd3 Oct 24, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test: test_v4l2_udev_poll_error flakes on its 50 ms wall-clock bound

2 participants