Skip to content

buzz-relay lib tests are archived but not run in CI — 771 of 804 never execute, including the mesh and tunnel/lease suites #3461

Open

Description

@brocoppler

Summary

buzz-relay's library tests are compiled in CI but almost none are executed. Of 804 tests in cargo test -p buzz-relay --lib, CI runs 12 — the #[ignore]d subset of api::invites::tests. All 771 non-ignored tests, including the entire mesh, tunnel/lease, subscription, media-auth, and pubsub-fanout suites, execute nowhere in any workflow.

This looks unintentional rather than a deliberate policy: the backend-integration job already provisions Postgres, Redis, and MinIO, and the nextest archive is explicitly built with -p buzz-relay --lib. The filter that selects tests from that archive was written for the invite suite and appears never to have been broadened.

Evidence

Every test invocation across .github/workflows/:

Location Runs
ci.yml:129 just test-unit → buzz-core, buzz-auth, buzz-db --lib, buzz-conformance, buzz-push-gateway (justfile:275). No buzz-relay.
ci.yml:687 archive, -E '(package(buzz-db) and test(/relay_invite::tests/)) or (package(buzz-relay) and test(/api::invites::tests/))' --run-ignored ignored-only
ci.yml:699 archive, -E 'binary(e2e_event_reminder)' --run-ignored ignored-only
ci.yml:740-742 buzz-test-client e2e (persona, nostr_interop, relay invite, nip43)
ci.yml:970, ci.yml:1005 buzz-dev-mcp, desktop Tauri (Windows)

The archive is created at ci.yml:351 with -p buzz-db -p buzz-relay -p buzz-test-client --lib, so the binaries exist; only those two -E filters ever select from it, and both pass --run-ignored ignored-only.

Reproduce the counts:

cargo test -p buzz-relay --lib -- --list | grep -c ': test$'                    # 804
cargo test -p buzz-relay --lib -- --list --ignored | grep -c ': test$'          #  33
cargo test -p buzz-relay --lib -- --list --ignored | grep -c 'api::invites'     #  12  ← what CI runs

Why it matters

This is the reason #2458 survived in main. api::mesh_demo::tests::demo_join_forwarded_arm_round_trips_echo fails roughly half the time on a machine with Redis — I measured 5/10 failures on origin/main @ 22be8bb, and @tlongwell-block and two others reproduced it independently this week. A test with that failure rate cannot survive a CI that runs it. It survived because CI never has.

The same blind spot covers tunnel::directory (lease acquisition, fencing, TTL takeover) and tunnel::reliable (ownership routing, renewer loss signalling) — the coordination primitives underneath the mesh.

There is a second, related trap that @tlongwell-block flagged on #2458: 11 of these tests call redis_directory_if_available() and return early, silently, and green when Redis is unreachable (tunnel/directory.rs ×4, tunnel/reliable.rs ×4, api/mesh_demo.rs ×2, handlers/event.rs ×1). So even running them locally without infra proves nothing, and the output is indistinguishable from real coverage.

Cost to fix

Approximately zero. The full non-ignored suite against local Postgres + Redis:

test result: ok. 771 passed; 0 failed; 33 ignored; 0 measured; 0 filtered out; finished in 2.22s

2.22 seconds, all green, in a job that already has the services running.

Suggested fix

Add a step to backend-integration (which already has Postgres/Redis/MinIO up and the archive downloaded) running the buzz-relay lib suite from the existing archive.

Ordering matters: enabling this today makes CI flake about half the time on the #2458 test. #2745 fixes that flake — I isolated the mechanism to cancel-safety in run_demo_echo with a 2×2 matrix at N=10 per cell (detail) — so the clean order is #2745 first, then switch this on.

Making the silent Redis skips loud is worth doing alongside, so a green run without infra can't read as coverage. #2745 already does this for the one live-transport variant it touches.

Happy to send both as a PR if the direction is right — I did not want to change CI policy unilaterally.

Activity

  1. mfanafuthimhlanga commented on Aug 3, 2026

    @mfanafuthimhlanga

    Confirming this from a second angle, and extending it: the same gap covers two more crates that this issue does not mention.

    just test-unit (Justfile:275) covers buzz-core, buzz-auth, buzz-voice, buzz-cli, buzz-db --lib, buzz-conformance, buzz-push-gateway. Beyond the buzz-relay case documented above, buzz-workflow and buzz-acp are referenced by no cargo test or nextest invocation anywhere in .github/workflows/ or scripts/run-tests.sh. buzz-acp appears only in build and release contexts — the Justfile binary loops and sprig.yml.

    Crate Lib tests Runs in CI
    buzz-relay 804 (12 run) partially, per this issue
    buzz-workflow 154 no
    buzz-acp 661 no

    Unlike buzz-relay, both of these are genuinely infra-free and pass clean on first execution:

    Summary [0.306s] 154 tests run: 154 passed, 2 skipped
    Summary [13.080s] 661 tests run: 661 passed, 0 skipped
    

    So they can be wired into the unit gate with no infrastructure work at all. Opened #4590 for exactly that, scoped to those two crates and explicitly leaving buzz-relay to this issue — -p buzz-relay --lib surfaces four tests in api::admin and api::media that need Postgres but are not #[ignore]d, so they hang ~30s each and then fail, and nextest's fail-fast then cancelled 628 of 840 remaining. Marking those four looks like the right first step here.

    One detail worth adding to your "silently green" point, since it bit me: under nextest's default profile a test that never runs is indistinguishable from one that passes, because only slow tests get individual PASS lines. I only caught this by adding a test, watching CI go green, then inverting the assertion so it had to fail — and CI stayed green. Same failure signature as the redis_directory_if_available() early-return trap you describe, one layer up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions