Skip to content

test(leadline): the collector's tests wait for what they wrote, however slow the machine - #58

Merged
sean-brydon merged 1 commit into
mainfrom
fix/leadline-ci-tests
Oct 12, 2026
Merged

sean-brydon merged 1 commit into
mainfrom
fix/leadline-ci-tests

Conversation

@sean-brydon

Copy link
Copy Markdown
Collaborator

The Go job has failed on every run since the Leadline collector landed (#54, #56, #57): TestEndpoints, TestEndpointsSortSearchAndScope (a panic indexing the first row), TestHeatmapAndBreakdownAPI and TestListsPageByCursor all read an empty store.

Cause. The store batches writes in the background, and a read waits at most one second for rows still on their way in. That is right for a stalled disk. On CI's Linux runner under -race, writing the demo's 400 traces takes longer than a second, so the tests read before the batch landed. On a fast Mac it never showed.

Fix. The wait is now Options.ReadWait (one second when not given, so the helper behaves as before), and the tests that write a batch and read it back set it to a minute.

Checked. A throwaway test with a read that does not wait reproduces CI's result exactly (0 endpoints where 6 are wanted). go vet and go test -race -count=2 ./internal/leadline/... pass locally, and the helper still cross-builds for linux/amd64. The real proof is this PR's own Go job on the Linux runner.

No behaviour change outside tests.

🤖 Generated with Claude Code

…er slow the machine

A read waits at most a second for rows still being written, which is right
for a stalled disk and wrong for a test: on CI's Linux runner under -race,
writing the demo's 400 traces takes longer than that, so the store and api
tests read an empty store and failed (0 endpoints, an empty heatmap, a
panic indexing the first row). They passed on a fast Mac.

The wait is now Options.ReadWait (a second when not given), and the tests
that write a batch and read it back set it to a minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
berth Ready Ready Preview Oct 12, 2026 6:37am UTC
berth-docs Ready Ready Preview Oct 12, 2026 6:37am UTC

Request Review

@sean-brydon
sean-brydon merged commit 2868ace into main Oct 12, 2026
8 checks passed
@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

ENG-5905

This branch was successfully deployed

2 active deployments
Preview – berth-docs — 3587feba Deployed Oct 12, 2026 by vercel[bot]
Preview – berth — 3587feba Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant