Repository navigation
test(leadline): the collector's tests wait for what they wrote, however slow the machine - #58
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Go job has failed on every run since the Leadline collector landed (#54, #56, #57):
TestEndpoints,TestEndpointsSortSearchAndScope(a panic indexing the first row),TestHeatmapAndBreakdownAPIandTestListsPageByCursorall 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 vetandgo 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