Skip to content

Flaky: test_v4l2_busy_signal force_camera_closes_the_holder_and_opens_the_camera fails under Tier 2 -j4 #953

Closed

Description

@zackees

test_v4l2_busy_signal (added with #800) fails intermittently in Tier 2 Linux in force_camera_closes_the_holder_and_opens_the_camera (about 6 s, then fail), on PRs that don't touch linux-v4l2.

Seen:

Likely a timing assumption about the holder process exiting or releasing the device, which breaks under machine load since Tier 2 moved to ctest -j4 (#837). Related: #838 (load-sensitive audio tests).

Fix should make the test wait on the holder's exit or the device becoming free instead of a fixed delay, shown RED under load (e.g. stress or -j with parallel load) then GREEN.

Activity

  1. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Claiming. Cause: the fake libv4l2 in the test decides "busy" with waitpid(holder, WNOHANG) == 0. After Force Camera sends SIGTERM, the holder closes its fds before it becomes a reapable zombie. The plugin's /proc scan sees the device free in that window (so released is true), but the reopen's waitpid(WNOHANG) can still return 0: the fake answers EBUSY, fake.holder keeps the pid, and the test fails with <pid> != 0 at line 296 (I hit 10185 != 0 in a loaded local run, logged on #838). The window widens under load.

    Fix (test fixture only, the plugin is right): the fake treats the holder as holding the device only while /proc/<pid>/fd still has camera_path open, the same view the plugin has; with no fd left it is exiting, so a blocking waitpid reaps it and records the SIGTERM status deterministically. The ignore_term holder keeps its fd and stays busy.

    Evidence: run.sh --repeat N --tests test_v4l2_busy_signal under load, failing before and passing after.

  2. added
    claimed
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions