test(relay): gate 9 deterministic env-coupled test failures behind requires-Postgres ignore - #4356
test(relay): gate 9 deterministic env-coupled test failures behind requires-Postgres ignore#4356iroiro147 wants to merge 1 commit into
Conversation
Narrows block#4356 to the 9 deterministic infra-coupled gates only (media x7, admin x2). The trace_context_lookup flake is the global callsite-interest-caching mechanism reported in block#3929, which my ENV_LOCK serialization does not actually address (the reporter's own analysis calls the ENV_LOCK signal an unproven hypothesis). block#3981 fixes it properly with a per-statement unique callsite target; block#4059's ENV_LOCK attempt was already closed in favor of block#3981. Don't ship the weaker, duplicated mechanism here. After this change the PR gates the 9 deterministic infra failures via the crate's existing #[ignore="requires Postgres"] convention; the telemetry flake stays un-gated and is tracked by block#3929 / fixed by block#3981. Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
|
Scope note (follow-up |
|
Standing-health check (re-verified against current
Ready for review; no action needed. |
On a checkout with no local Postgres/Redis sidecar, `cargo test -p buzz-relay --lib` fails 10 tests on clean main: - 7 media tests + 2 admin tests reach an unreachable localhost Redis (`redis://127.0.0.1:1`) / PG connection inside `test_state()` and panic at init rather than asserting anything. - 1 telemetry subscriber test races with other in-flight subscribers under the default multi-threaded runner (passes with `--test-threads=1`, flakes in `--lib`). This is the same env-coupling class the crate already handles with `#[ignore = "requires Postgres"]` / `#[ignore = "requires Redis"]` (used ~38x across operator.rs/bridge.rs/invites.rs). These 9 tests use `test_state()` but were missing the annotation their siblings carry, so a plain `--lib` run stayed red for anyone without a live sidecar. Add the missing `#[ignore = "requires Postgres"]` to the 9 infra-coupled tests so the suite skips them (matching existing convention; they still run when explicitly requested with `-- --ignored`). For the telemetry flake, take the module's shared `ENV_LOCK` serial guard so the `with_default` subscriber state it asserts on does not race other subscriber-touching tests. Verified empirically: 3 consecutive full `--lib` runs at 827 passed / 0 failed / 46 ignored; previously 826/10/37. This is best-effort serialization (the crate does not depend on `serial_test`); the test was already deterministic in single-thread mode, the lock removes the observed multi-thread flake. Reported-by context: surfaced during independent verification of the Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in> Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
a245477 to
b036472
Compare
|
Rebased onto current main. Resolved merge conflict in |
Gates the 9 deterministic, env-coupled test infra failures on clean
mainbehind the crate"'s existing#[ignore = "requires Postgres"]convention, socargo test -p buzz-relay --libskips them without a live Postgres/Redis sidecar. Surfaced during independent verification of the #4192 gift-wrap freshness fix (#4253).Scope after follow-up
a2454776Narrowed. An earlier revision also added an
ENV_LOCKserializer to the flakytrace_context_lookup_does_not_enable_callsitestelemetry test. That piece is reverted here: the flake is the global callsite-interest-caching mechanism from #3929, which locking does not address (the reporter"'s own issue calls theENV_LOCKsignal an unproven hypothesis), and the reporter-preferred root-cause fix already exists as #3981 (per-statement unique callsite). #4059'sENV_LOCKattempt was already closed in favor of #3981.So this PR now does only its non-duplicated job: the 9 infra gates. The telemetry flake stays un-gated and is tracked by #3929 / fixed by #3981.
The 9 gated failures (clean
main@28ae6cd21)7 media + 2 admin tests panic inside
test_state()reaching for unreachable localhost Redis (redis://127.0.0.1:1) / Postgres — they die at setup before asserting.These use
test_state()but were missing the#[ignore]annotation their ~38 infra-coupled siblings carry (operator.rs,bridge.rs,invites.rs). Additive only (+9).Verification
cargo test -p buzz-relay --lib: deterministic infra failures nowignored; the only remaining failure is the pre-existing probabilistic telemetry flake (~1/6), owned by test(relay): telemetry trace_context_lookup test flaky under parallel suite — reproduces on clean main #3929/test(relay): give trace_context_lookup test a per-statement unique target (#3929) #3981.cargo fmtclean;cargo checkwarning-free.