Skip to content

posix/test.zig: "sigset_t bits" test is flaky #24380

@rootbeer

Description

@rootbeer

Zig Version

0.15.0-dev.911+31bc6d5a9

Steps to Reproduce and Observed Behavior

Andy has seen flaky failures in the "sigset_t bits" posix test:

expected 1, found 0
1793/2920 posix.test.test.sigset_t bits...FAIL (TestExpectedEqual)
/home/andy/dev/zig/lib/std/testing.zig:109:17: 0x1f34c4d in expectEqualInner__anon_46282 (test)
                return error.TestExpectedEqual;
                ^
/home/andy/dev/zig/lib/std/posix/test.zig:1057:17: 0x2ee9c3f in test.sigset_t bits (test)
                try testing.expectEqual(1, S.handler_called_count);
                ^

The test is "native on my x86_64 host" and "it's rare; I've seen it twice in the last week across hundreds of runs".

Current theories are:

  • signal delivery is delayed
  • write to S.handler_called_count isn't visible after handler interrupts code
  • some other signal handlers (child processes?) are creating conflicts with this test

Expected Behavior

Test is robust and doesn't flake.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavioros-linuxstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions