Skip to content

test(store): wait for append before checking head - #408

Draft
loglapa wants to merge 1 commit into
celestiaorg:mainfrom
loglapa:fix/test-store-sync-head
Draft

test(store): wait for append before checking head#408
loglapa wants to merge 1 commit into
celestiaorg:mainfrom
loglapa:fix/test-store-sync-head

Conversation

@loglapa

@loglapa loglapa commented Aug 21, 2026

Copy link
Copy Markdown

Overview

Stabilizes TestStore by waiting for the asynchronous append pipeline before asserting the contiguous head. Store.Append intentionally returns after enqueueing writes (see #244), and GetRange can observe pending headers before advanceHead updates contiguousHead; the previous test therefore compared the new range with the old head intermittently.

The production behavior is unchanged.

Validation

  • Reproduced the original test failure 3 times in 200 runs
  • Updated test: 500/500 focused runs pass
  • go test ./store
  • go test -race ./store
  • go vet ./...
  • golangci-lint run (0 issues)
  • git diff --check

The repository-wide suite is currently blocked on an unrelated deterministic panic introduced on main by merged #406 (TestExchangeServer_partialRangeNotExpanded calls the newly required Tail method through a nil embedded store). It reproduces on both Go 1.26/darwin and Go 1.27/linux; details are posted on #406. This PR changes only store/store_test.go.

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