Skip to content

test(core): de-flake message_features (core_message_bdd) — concurrent ask/tell race #106

Description

@joeldsouzax

The message_features runner (tests/core_message_bdd.rs) has a flaky scenario:
the concurrent ask/tell property — "When concurrent tasks send a mix of asks and tells"
"the final state equals the deterministic result of applying every command once" /
"no command is lost or applied twice".

Symptom: passes ~13/14, fails ~1/14 (panic in cucumber-0.23 cucumber.rs:1243, "1 step failed").

Where it bites:

Likely root cause: the test asserts final state before all spawned tasks have settled — a classic concurrency snapshot-timing bug (assert fires a hair early), not a bug in the SUT.

Fix (de-flake, don't loosen the assertion):

  • Ensure real overlap with a tokio::sync::Barrier, then await every spawned task/join handle before snapshotting state (per CLAUDE.md test-quality rule 8: "concurrent tests use real overlap … not sequential-then-check").
  • Keep the assertion exact (deterministic fold of all commands), just move it after the join.

Sibling of the supervision de-flake #100. Surfaced during card #104 (repo hardening / clippy-gate parking).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions