Area: ingest — tests
TestRejectPoison_CountedByDisposition (internal/ingest/worker_test.go) fails on every run after the first in one process: go test -race -count=2 -run TestRejectPoison_CountedByDisposition ./internal/ingest fails on run 2 (and 3, with -count=3). It passes at -count=1, which is what make ci uses, so CI never sees it. It reproduces on main (measured on main and on #624's branch; the test came from #554).
Likely cause (inferred, not confirmed): the test swaps the global meter provider with otel.SetMeterProvider and reads wavehouse_ingest_poison_total through a fresh ManualReader. The ingest package's instruments are created once from the global provider, and OpenTelemetry's global delegation binds them to the first provider set. On the second run the counter still records into the first run's provider, so the new reader sees nothing, or the totals carry over.
Why it matters: -count=N and -test.shuffle are the usual way to shake out flaky tests, and this test makes them fail in internal/ingest for a reason unrelated to the code under test.
Fix direction: give the worker its instruments through a metric.MeterProvider passed in (or a package-level hook the test can set) rather than the global, or have the test read deltas from its own reader instead of absolute totals. Check the other tests in internal/ingest that call otel.SetMeterProvider for the same pattern.
Test: go test -race -count=3 ./internal/ingest passes.
Related: #554.
Area: ingest — tests
TestRejectPoison_CountedByDisposition(internal/ingest/worker_test.go) fails on every run after the first in one process:go test -race -count=2 -run TestRejectPoison_CountedByDisposition ./internal/ingestfails on run 2 (and 3, with-count=3). It passes at-count=1, which is whatmake ciuses, so CI never sees it. It reproduces onmain(measured on main and on #624's branch; the test came from #554).Likely cause (inferred, not confirmed): the test swaps the global meter provider with
otel.SetMeterProviderand readswavehouse_ingest_poison_totalthrough a freshManualReader. The ingest package's instruments are created once from the global provider, and OpenTelemetry's global delegation binds them to the first provider set. On the second run the counter still records into the first run's provider, so the new reader sees nothing, or the totals carry over.Why it matters:
-count=Nand-test.shuffleare the usual way to shake out flaky tests, and this test makes them fail ininternal/ingestfor a reason unrelated to the code under test.Fix direction: give the worker its instruments through a
metric.MeterProviderpassed in (or a package-level hook the test can set) rather than the global, or have the test read deltas from its own reader instead of absolute totals. Check the other tests ininternal/ingestthat callotel.SetMeterProviderfor the same pattern.Test:
go test -race -count=3 ./internal/ingestpasses.Related: #554.