Skip to content

test: evidence-export descendant kill check can read the process before SIGKILL lands #412

Closed

Description

@ElbertePlinio

The test kills the ffmpeg process group and settles when a descendant keeps stdout open in packages/core/test/evidence-export.test.ts failed once in a full bun run test:coverage run on a loaded local host:

AssertionError: expected false to be true
 ❯ packages/core/test/evidence-export.test.ts:633:52
    expect(status === "" || status.includes(") Z ")).toBe(true);

The same test passed 5 times in a row when run alone on the same revision.

Likely cause: packages/core/src/evidence-export.ts:312 sends SIGKILL to the process group, and kill returns before the kernel ends the target. The test reads /proc/<pid>/stat of the sleep descendant once, right after the export settles. Under load, the descendant can still show S at that moment.

Found while running the full suite for #317, which does not touch evidence export.

  • Wait for the descendant to end, for example with expect.poll, instead of one read of /proc/<pid>/stat.
  • Keep the assertion that the export settles in under 2.5 s.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions