Flaky tests: disputes, orders and relay-blacklist tests fail under the full parallel cargo test run
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the three named tests in src/api/disputes.rs and src/api/orders.rs, then inspect the relay-blacklist test and the shared state they read or mutate. Run the provided loop from rust to reproduce failures under parallel test execution, and compare with each test run alone. Done means the full repeated cargo test --lib runs pass reliably.
Written by the indexing model from the issue text.
Description
What happens
cargo test --lib fails intermittently on tests that pass when run alone, and a different set fails on each full run. The pre-commit hook runs the full suite, so this blocks commits at random (it blocked a commit on #438 that did not touch Rust).
Observed on feat/invoice-redesign (Rust identical to main + api::invoice), 2026-09-12:
| Run | Result | Failing tests |
|---|---|---|
| pre-commit hook, 1st commit of #438 | 509 passed | — |
| pre-commit hook, review-round commit | 506 passed, 3 failed | api::disputes::tests::the_solver_pubkey_outlives_the_in_memory_record, api::orders::tests::replayed_cancel_over_terminal_trade_is_skipped, api::orders::tests::replayed_take_over_terminal_trade_has_no_side_effects |
cargo test --lib, right after |
507 passed, 2 failed | api::disputes::tests::the_solver_pubkey_outlives_the_in_memory_record, api::nostr::relay_blacklist_restart_tests::a_removed_announced_relay_stays_out_across_a_restart_until_re_added |
each test alone (--exact) |
all pass | — |
| pre-commit hook, retry | passed | — |
Where they panic
src/api/disputes.rs:1190— after reopening the SQLite store,get_setting(&key)does not return the solver pubkey that was just written.src/api/orders.rs:8133andsrc/api/orders.rs:9698—order_book().get_order(&order_id)after dispatching a replayed message: the cached order is missing or its status is not the expected terminalSuccess.
Likely cause (not verified)
All of them read or write process-global state — the order_book() cache, the app DB / settings store, the relay blacklist — that other tests running in parallel also mutate. That is the same shape as #309 (two locks, one global). The fix is probably either serialising these tests on the lock their globals already use, or giving each test its own isolated order id / DB path.
Repro
cd rust
for i in 1 2 3 4 5; do cargo test --lib 2>&1 | grep -E "^test result|FAILED"; done
🤖 Generated with Claude Code
- Dominant language
- Dart
- Stars
- 11
- Forks
- 9
- Avg merge
- 12h 41m
- Merged PRs (30d)
- 265
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MostroP2P/app
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Add-invoice screen stays on "Sent, waiting for the node" after a late acceptance on a sell orderOpenbug priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area: ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MostroP2P/app#341 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
bug product: very_good_flutter_plugin
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
VeryGoodOpenSource/very_good_templates#654 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Server never consumes the request body on early-error paths: _sinkIncoming does not resume the paused subscriptionMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
[BUG][All] VLESS URIs with flow=xtls-rprx-vision-udp443 are silently dropped on subscription importOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
simonoppowa/OpenNutriTracker#1336 ·
Maintainers usually reply within 1 day