Skip to content

test(registry): reconcile stale WAL torn-tail test with current contract#251

Merged
TeoSlayer merged 1 commit into
mainfrom
fix/wal-torn-tail-stale-test
Jun 16, 2026
Merged

test(registry): reconcile stale WAL torn-tail test with current contract#251
TeoSlayer merged 1 commit into
mainfrom
fix/wal-torn-tail-stale-test

Conversation

@TeoSlayer

Copy link
Copy Markdown
Collaborator

Summary

tests/pkg/registry/server/zz_wal_test.go is an older mirror of the
rendezvous WAL test suite. Its TestReplayErrorsOnTruncatedData asserted
that Replay hard-errors on a truncated record — but the rendezvous WAL
deliberately tolerates a torn tail (a crash between the length-prefix
write and the payload write): it replays the complete entries and drops
the torn tail, returning no error. That behavior is documented in
wal.Replay and covered by rendezvous wal.TestWALReplayTornTail, so this
package's stale expectation fails against the current dependency.

Fix

Replace it with TestReplayToleratesTornTail, asserting the real contract:

  • a lone torn record replays nothing (count 0, no error);
  • a complete entry survives a trailing torn tail (count 1, no error).

Notes

  • Found via an across-the-board test sweep; this package isn't in the PR
    CI scope (ci.yml runs ./pkg/... ./cmd/... ./internal/...), so it
    wasn't gating, but it was a real stale failure.
  • go test ./tests/pkg/registry/server/ now green.

@TeoSlayer TeoSlayer requested a review from Alexgodoroja as a code owner June 15, 2026 17:50
tests/pkg/registry/server held a stale mirror of the rendezvous WAL test
suite: TestReplayErrorsOnTruncatedData expected Replay to hard-error on a
truncated record. The rendezvous WAL deliberately tolerates a torn tail (a
crash between the length-prefix and payload writes) — documented in
wal.Replay and covered by rendezvous wal.TestWALReplayTornTail — replaying
complete entries and dropping the torn tail.

Replace it with TestReplayToleratesTornTail asserting the real contract:
a lone torn record replays nothing; a complete entry survives a trailing
torn tail. No error in either case.
@TeoSlayer TeoSlayer force-pushed the fix/wal-torn-tail-stale-test branch from 7e2ed20 to 936a384 Compare June 16, 2026 07:36
@TeoSlayer TeoSlayer merged commit 388805b into main Jun 16, 2026
10 of 11 checks passed
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.

2 participants