Skip to content

Flaky: grok exact store lookup misses the held session beside an older events file on CI #1994

Closed

Description

@devswha

server/grok.test.ts › "exact store lookup › resolves Herdr's session safely when another file is held beside an older session's events file" failed once in CI on an unrelated PR (#1979, which does not touch Grok code):

server/grok.test.ts:330:46
expect(await resolveGrokStore(pane)).toBe(scenario.binds ? transcript : null);
Expected: "/tmp/herdr-grok-unit-wvKOFG/sessions/%2Ffiction/fictional-session/updates.jsonl"
Received: null

Job: https://github.com/devswha/ovis/actions/runs/40297912871/job/121490052568 (Fast checks, ubuntu runner, Node PTY host)

Locally the same describe passes 12 runs out of 12 (bun test server/grok.test.ts -t "exact store lookup"), and bun run check fast passed on the same tree. The scenario holds files open in a spawned child and resolves the store from its descriptors right after the child's spawn event, so the test may read the child's descriptors before they are all visible on a loaded runner. Recent changes in this area: #1733, #1894, #1858.

Activity

  1. devswha commented on Oct 26, 2026

    @devswha
    OwnerAuthor

    It happened again on #1979's rerun (head 19d2346, which touches no Grok code), with the same assertion at server/grok.test.ts:330: https://github.com/devswha/ovis/actions/runs/40306658219/job/121545080405. Two of two Fast checks runs on that branch hit it, and it passes locally.

  2. devswha commented on Oct 26, 2026

    @devswha
    OwnerAuthor

    A lead for whoever picks this up: in the failing scenario, server/grok.test.ts:279 writes the closed session's events.jsonl beside the lock without utimesSync, so its mtime is the current time, newer than the reported session's events.jsonl (200). Every other file in the scenario gets a fixed mtime. If resolveGrokStore weighs mtimes when it judges a held file beside an events file, this one is the time-dependent input.

  3. added a commit that references this issue on Oct 26, 2026
    61efd73
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions