Skip to content

test-probe flake: the fork fixture's pidfile can be read empty #113

Closed

Description

@linuxnow

What happens. a_process_an_lv2_plugin_left_in_its_own_session_is_gone_after_the_run (tests/probe_test.py) failed once in four runs of make test-probe with

pid = int(open(pidfile).read())
ValueError: invalid literal for int() with base 10: ''

Why. The fixture's forked process (tests/lv2_fixture.c, fault_once, fault fork) does setsid(), then fopen(pidfile, "w"), then fprintf. The runner kills the whole tree when the child is done, which is what the test asserts, and it can land between the fopen and the write: the file exists and is empty. The test only checks that the file exists before it reads the pid.

Fix. The fixture writes the pid to a temporary file and renames it onto STRESS_FORK_PIDFILE (tests/stress_plugin.c too, if it writes the same way). Then the file is either absent or holds the pid. The test can then tell "the plugin did not get as far as forking" apart from "the leftover was killed".

Seen on origin/main 5016567 plus the #109 branch. The test is unchanged on that branch.

Activity

  1. linuxnow commented on Oct 28, 2026

    @linuxnow
    ContributorAuthor

    Two open PRs carry this fix with the same title: #173 and #210 (the latter re-signs the fix). Keep one; close the other when it merges.

  2. added a commit that references this issue on Oct 28, 2026
  3. linuxnow commented on Oct 28, 2026

    @linuxnow
    ContributorAuthor

    Fixed on origin/main by e3633eb (PR #210, merge b8b986e): the fork fault returns once the process it leaves behind has written its pid, so the pidfile is no longer read empty.

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

    P3Hygiene — quarterly sweep

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions