Skip to content

Windows CI: upload-retention retry after a superseded policy never arrived (flake, root cause unknown) #536

Open

Description

@andrebrait

What failed

lib/hosts/upload-retention-sync.test.mjs: "a pending retry cannot restore an older policy or run after disconnect" failed once on windows-latest (PR #534, run 44379242526, attempt 2): timed out waiting for the current policy to retry at line 163.

The test sets retention to 7 and then to null ("never"); the daemon fails both. The retry for null (after ~1 s, send in lib/hosts/upload-retention-sync.ts) never reached the daemon within 5 s. The 7 → null updates themselves arrived.

What was ruled out

  • Settings: loadWebServerSettings() is the in-process cache that saveWebServerSettings updates; nothing invalidates it; the PUT route pushes only the changed value.
  • The fake daemon (link-driver.test-helper.mjs serve) answers every request in order and keeps serving after a failure.
  • Hooks or timers left by earlier tests in the file: each drops its links and stops its sync.
  • No reproduction on Linux: 90 runs of the file under full CPU load pass. Not seen in the 40 CI runs before it.

Open lead

The retry uses an unref'd setTimeout. If Bun on Windows fails to fire an unref'd timer in some condition, a retention retry would be lost in the product too (the daemon keeps its previous setting until the next hello or change). Needs a Windows reproduction, e.g. the file with --rerun-each on windows-latest.

Activity

  1. andrebrait commented on Nov 18, 2026

    @andrebrait
    CollaboratorAuthor

    Two more Windows-only timing failures on #534's runs, each once, both passed on rerun at normal speed:

    • lib/message-outbox-review.test.mjs "concurrent processes share the 1000-row active pool…": SQLiteError: database is locked from the autocommit pruneDelivered before an add (six writer processes). fix(outbox): prune delivered rows inside the add's write transaction #535 now runs that prune inside the add's own transaction, halving lock acquisitions per add.
    • lib/message-outbox.test.mjs "the active outbox UTF-8 budget is atomic and shared by aliases": 42.8 s against its usual 1.5–3.5 s on Windows (single process, no other writer); the 30 s timeout fired but the test ran on, so something stalled ~40 s (a synchronous SQLite/disk call or an await). Cause unknown.

    All three are Windows-only, none failed in the 40 CI runs before #534. A Windows reproduction (repeating these files on windows-latest) is the next step.

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