Skip to content

test: Windows output-delay reconnect assertion intermittently fails exact 2 s lower bound #1598

Closed

Description

@zackees

Observed failure

On unchanged libobs/output-delay code at 47025f8, Windows Tier 2 job 119005047680 failed test_output_delay_e2e / preserve_holds_queue_through_reconnect at test/cmocka/test_output_delay_e2e.c:519:

os_gettime_ns() - disconnect >= 2 * NS_PER_SEC is not true

The other four cases passed. The harness immediately replayed the same executable under cdb; all five cases passed. No exception stack was reported: the original failure is the test assertion. The facade-only diff in #1597 does not change output/reconnect/timing code.

Investigation

The test asks for a two-second reconnect, then compares os_gettime_ns elapsed time against an exact two-second lower bound. reconnect_thread performs os_event_timedwait(..., 2000); the C Windows implementation uses WaitForSingleObject. Windows timer expiration accuracy depends on clock granularity (Microsoft timer accuracy). Timer granularity is a plausible explanation, not established by the failing log: elapsed nanoseconds were not printed.

Expected / next steps

Make this test portable and deterministic without weakening queue retention, packet-order or reconnect behavior assertions. First add elapsed-time diagnostics and characterize the Windows wait contract. Prefer synchronization/injected clocks for timing policy over wall-clock sleeps. Preserve existing assertions until a justified test repair is agreed; do not change the Rust port to mask it.

One targeted retry of the failed Windows job will be attempted for #1597; no whole-workflow rerun or source change is being made merely to retry.

Activity

  1. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Claiming: #1598.

    1. Add a deterministic compiler fixture reproducing a 2000 ms Windows event wait returning just before the exact QPC lower bound, and test the reconnect timeout reported by OBS.
    2. Replace the invalid exact OS-timing assertion with an assertion on OBS's requested two-second reconnect timeout from the reconnect signal, retain elapsed diagnostics, and preserve all queue-retention, active-delay, packet-order and stop assertions.
    3. Verify real C/Rust output-delay execution on Windows and Linux, plus PR CI and normal merge queue. First draft expected within 30 minutes.

    Decisions: This is a test repair, not a Rust port or a change to production timers. No arbitrary clock tolerance or retry-based masking. Windows relative timers can expire within one system clock tick of their nominal time (Microsoft Timer Accuracy documentation); exact hardware elapsed time is not an OBS policy contract. The existing delay-growth and queued-packet checks remain end-to-end checks of the outage.

  2. added
    claimed
    on Oct 21, 2026
  3. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Completed in #1601 (merge c9b06b3).

    The reconnect test now observes exactly one reconnect signal with the requested two-second timeout, and retains elapsed nanosecond diagnostics. This replaces only the invalid exact OS-timer elapsed lower bound. Every other existing queue, packet, active-delay, start/stop and case-registration assertion is unchanged. No production code or Rust behavior was changed.

    RED 915566a reproduces a false failure one nanosecond before the nominal deadline and missing timeout validation. GREEN be053d7 passes four focused tests, including injected wrong timeout values and five deliberately bad behavior snapshots that must still fail. Linux output-delay passes OFF 9.59 s / ON 9.60 s. Windows Tier 2 job 119041878897 passes all 167 tests per mode, with output-delay OFF 9.55 s / ON 9.54 s. PR run 39544716923, complete native run 39544953077 and merge-group run 39546012802 all succeeded without retries. No remaining work for this issue.

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