Skip to content

Flaky test: TestReadCacheBlamesOnlyFilesThatFailAlone fails under the race detector #539

Backlog

Description

@vishr

TestReadCacheBlamesOnlyFilesThatFailAlone in internal/engine/file_snapshot_test.go failed once in the Go race (engine) job and removed #536 from the merge queue. The same commit passed on requeue.

--- FAIL: TestReadCacheBlamesOnlyFilesThatFailAlone (1.79s)
    file_snapshot_test.go:865: fresh files stopped caching: map[fresh-00:true ... fresh-10:true good:true]

Run: https://github.com/labstack/pitot/actions/runs/47160397750

Every file cached except fresh-11, the one committed in the last of the 12 passes.

Likely cause, not confirmed: the failure backoff uses the wall clock (batch_cache.go, first retry after 1 second). The test took 1.79s under the race detector, so the backoff for bad-a and bad-b may have expired before the final pass. They would then rejoin that pass and fail it beside fresh-11. On a fast run all 12 passes finish inside the first second.

Seen once in the last 15 failed CI runs. To do: reproduce with a delay between passes, then give the test a controllable clock or assert on behavior that does not depend on elapsed time.

Activity

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