fix: all failing tests — test isolation, data race, flaky handoff #174

Merged
ash merged 3 commits from fix/test-isolation into main 2026-03-02 23:20:18 +00:00
Owner

Closes #173

All 16 packages pass with -race, zero failures.

  1. cleanEvents() truncates shared events table before global reader tests
  2. Mutex on memReader test helper (data race)
  3. Poll loop replaces fixed sleep in handoff test (flaky)
Closes #173 All 16 packages pass with -race, zero failures. 1. cleanEvents() truncates shared events table before global reader tests 2. Mutex on memReader test helper (data race) 3. Poll loop replaces fixed sleep in handoff test (flaky)
fix: test isolation for global reader tests
Some checks failed
CI / test-sqlitestore (push) Failing after 4s
CI / test-pgstore (push) Failing after 4s
CI / test-nats (push) Failing after 5s
CI / test-integration (push) Failing after 4s
CI / benchmarks (push) Failing after 4s
CI / test-codec-otelkit (push) Successful in 11s
CI / test-core (push) Failing after 1m8s
074e9ebbd5
Tests using PGGlobalReader (rebuild, SSE watch) read ALL events from the
shared events table. Events from other tests with different types cause
unmarshal failures, and non-contiguous IDs trigger the gap detector.

Add cleanEvents() helper that truncates the events table before tests
that use the global reader. Fixes TestRebuild_Postgres,
TestRebuildConcurrent_Postgres, and TestIntegration_SSE_PGStore_Watch.
fix: flaky TestLeaderLock_HandoffOnStop — use poll loop instead of fixed sleep
Some checks failed
CI / test-sqlitestore (push) Failing after 4s
CI / test-pgstore (push) Failing after 5s
CI / test-nats (push) Failing after 8s
CI / test-integration (push) Failing after 6s
CI / benchmarks (push) Failing after 6s
CI / test-codec-otelkit (push) Successful in 17s
CI / test-core (push) Has been cancelled
e560d9e057
The 500ms sleep was sometimes not enough for lock handoff + poll cycle.
Replace with poll loop (50ms intervals, 3s deadline) for deterministic test.
fix: data race in memReader test helper — add mutex
Some checks failed
CI / test-sqlitestore (push) Failing after 8s
CI / test-pgstore (push) Failing after 7s
CI / test-nats (push) Failing after 10s
CI / test-integration (push) Failing after 7s
CI / benchmarks (push) Failing after 7s
CI / test-codec-otelkit (push) Successful in 16s
CI / test-sqlitestore (pull_request) Failing after 5s
CI / test-pgstore (pull_request) Failing after 5s
CI / test-core (push) Successful in 1m16s
CI / test-nats (pull_request) Failing after 5s
CI / test-integration (pull_request) Failing after 3s
CI / benchmarks (pull_request) Failing after 3s
CI / test-codec-otelkit (pull_request) Successful in 11s
CI / test-core (pull_request) Successful in 1m14s
a915cc84e6
The memReader was accessed concurrently by test goroutines (append) and
subscription goroutines (ReadFrom/LatestSequence) without synchronization.
ash merged commit 18e15aef10 into main 2026-03-02 23:20:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ash/eskit!174
No description provided.