Skip to content

Flaky snapshot-queue exponential backoff timing test on Windows #171

@devallibus

Description

@devallibus

Summary

The snapshot-queue > exponential backoff timing test in packages/create-gametau/src/snapshot-queue.test.ts fails intermittently on Windows due to a timing assertion that is too tight for the platform's timer resolution.

Reproduction

bun test packages/create-gametau/src/snapshot-queue.test.ts

Fails roughly 1 in 3 runs on Windows 11 (Bun 1.3.8).

Error

snapshot-queue.test.ts:108
    expect(gap2).toBeGreaterThan(gap1 * 1.3);
                 ^
error: expect(received).toBeGreaterThan(expected)

Expected: > 59.93012999999985
Received: 46.49790000000007

The test asserts that the gap between retry attempt 1→2 is at least 1.3× the gap between attempt 0→1 (exponential backoff). On Windows, setTimeout granularity and scheduling jitter can compress the second gap below this threshold.

Location

packages/create-gametau/src/snapshot-queue.test.ts:108

Suggested fix

Relax the multiplier from 1.3 to something like 1.1, or assert that gap2 > gap1 without a strict ratio, or use a cumulative elapsed-time assertion instead of per-gap ratios.

Context

Found during local v0.7.0 Electrobun verification (post-release). All other 31 tests in the file pass consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtest

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions