# Reproduce ZcashFoundation/zebra's flaky tests in your own f+ DST account

f+ DST ran 15 of ZcashFoundation/zebra's tests in its deterministic simulator; the results are at
https://staging.extrafunctional-staging.fyi/dst/ZcashFoundation/zebra. This page is for your coding agent: it gives the tests, the commits and how to build the
image, so you can make them fail in your own account, replay them and check your fixes.

Do this, in a checkout of ZcashFoundation/zebra:

1. Install and sign in: step 1 of https://staging.extrafunctional-staging.fyi/dst.md.
2. Pick tests from the list below instead of scanning (or scan too: step 2 of /dst.md finds newer flakes).
3. Build the image at the test's commit (recipe below), push it, check, then hunt: steps 3 and 4 of /dst.md.
4. Compare your finding's error with CI's error below, then follow /dst.md from step 5.

## The image

Rust. Follow step 3 of https://staging.extrafunctional-staging.fyi/dst.md for Rust, and build each test at the commit its facts below name.

## The tests

### 1. side_fork_child_authenticates_and_remembers_rejection

- The test, as the results name it: zebra-state side_fork_child_authenticates_and_remembers_rejection (863f915e7 → 573fc2f1c, #12509)
- Here: reproduced, first failure after 45 s, replayed bit for bit
- CI's own message: the replayed side-fork body authenticates again (mining_rejection.rs:485), CI's message
- test (pre → fix commit, on next): zebra-state side_fork_child_authenticates_and_remembers_rejection (863f915e7 → 573fc2f1c, #12509)

### 2. ordinary_and_mined_rejections_suppress_mining_replay

- The test, as the results name it: zebra-consensus ordinary_and_mined_rejections_suppress_mining_replay (15a6b7889 → e4faa114a, #12535)
- Here: reproduced, first failure after 76 s, replayed bit for bit
- CI's own message: assertion left == right failed at mining_rejections.rs:108 (#12535: "0 != 1 at line 108")
- test (pre → fix commit, on next): zebra-consensus ordinary_and_mined_rejections_suppress_mining_replay (15a6b7889 → e4faa114a, #12535)
- reproduction: pre-fix commit: 15a6b7889
- reproduction: fix commit: e4faa114a
- reproduction: fplus-dst: f+ DST

### 3. compact_cf_range_drops_deleted_entries

- The test, as the results name it: zebra-state compact_cf_range_drops_deleted_entries (05c50f768 → 15a6b7889, #12536)
- Here: reproduced, first failure after 195 s, replayed bit for bit
- CI's own message: the entries and their deletion markers are on disk (disk_db/tests.rs:557), CI's message
- test (pre → fix commit, on next): zebra-state compact_cf_range_drops_deleted_entries (05c50f768 → 15a6b7889, #12536)

### 4. getblocktemplate_precomputed

- The test, as the results name it: zebra-rpc getblocktemplate_precomputed (3805088d4 → 863f915e7, #12509)
- Here: reproduced, first failure after 6.3 min, replayed bit for bit
- CI's own message: getblocktemplate should answer after a chain tip change: Elapsed(()) (vectors.rs:4237), CI's message
- reproduction: CI's failure: https://github.com/ZcashFoundation/zebra/actions/runs/41909185556/job/126851961246
- reproduction: same failure as CI: yes: matches the CI error
- test (pre → fix commit, on next): zebra-rpc getblocktemplate_precomputed (3805088d4 → 863f915e7, #12509)
- reproduction: pre-fix commit: f7d8ad50fcf934f865e8ed48da25964c323c7c15
- reproduction: fplus-dst: f+ DST

### 5. default_nodes_use_compact_blocks_and_disabled_peers_receive_full_blocks

- The test, as the results name it: zebrad compact_relay::default_nodes_use_compact_blocks_and_disabled_peers_receive_full_blocks (5977201d6 → 4ce7a7e7c, #12513; 3 zebrad, Regtest)
- Here: reproduced, first failure after 51 min, replayed bit for bit
- CI's own message: mempool did not reach the expected transaction set (the #12513 mechanism: the tx never reached node A's mempool)
- test (pre → fix commit, on next): zebrad compact_relay::default_nodes_use_compact_blocks_and_disabled_peers_receive_full_blocks (5977201d6 → 4ce7a7e7c, #12513; 3 zebrad, Regtest)
- reproduction: pre-fix commit: 5977201d6
- reproduction: fix commit: 4ce7a7e7c
- reproduction: fplus-dst: f+ DST

### 6. early_relay_unknown_and_non_tip_parents_do_not_reserve_publication

- The test, as the results name it: zebra-consensus early_relay_unknown_and_non_tip_parents_do_not_reserve_publication, approved target = next head 50e6bd1d4 (no fix known)
- Here: not reproduced
- test (pre → fix commit, on next): zebra-consensus early_relay_unknown_and_non_tip_parents_do_not_reserve_publication, approved target = next head 50e6bd1d4 (no fix known)

### 7. test_rpc_response_data

- The test, as the results name it: zebra-rpc methods::tests::snapshot::test_rpc_response_data (#10634, d5ccbbd4cb → 00c8efc548)
- Here: reproduced, first failure after 26 min, replayed bit for bit
- CI symptom: timeout while waiting for a request
- before this work: queue pause families: 4 in 22,343 runs (replay on pre 4/4, fix 4/4 OK); notes said "not reproduced"
- test (fix): zebra-rpc methods::tests::snapshot::test_rpc_response_data (#10634, d5ccbbd4cb → 00c8efc548)

### 8. crawler_peer_limit_one_connect_ok_then_drop

- The test, as the results name it: zebra-network peer_set::initialize::tests::vectors::crawler_peer_limit_one_connect_ok_then_drop (#11501, bcd0ab2da → 501f00ec6)
- Here: reproduced, first failure after 1.0 min, replayed bit for bit
- before this work: 2/40 at epoch 8; queue c1v2 0 in 103,256 runs
- test (fix): zebra-network peer_set::initialize::tests::vectors::crawler_peer_limit_one_connect_ok_then_drop (#11501, bcd0ab2da → 501f00ec6)

### 9. non_blocking_logger

- The test, as the results name it: zebrad unit::config::non_blocking_logger (#11471, f84277f28a → bcd0ab2da)
- Here: reproduced, first failure after 1.5 min, replayed bit for bit
- before this work: never run in a VM: zebrad on Mainnet blocks in network init without DNS (needed fplus-dst-seeders.yaml)
- test (fix): zebrad unit::config::non_blocking_logger (#11471, f84277f28a → bcd0ab2da)

### 10. trusted_chain_sync_handles_forks_correctly

- The test, as the results name it: zebrad e2e::trusted_chain::trusted_chain_sync_handles_forks_correctly (open, #[ignore]; our test fix TIP_CHANGE_TIMEOUT 1 s → 10 s)
- Here: reproduced, first failure after 16.5 min, replayed bit for bit
- before this work: pauses only (queue 202 in 66,353; zebra-flakes 2/120 blind)
- test (fix): zebrad e2e::trusted_chain::trusted_chain_sync_handles_forks_correctly (open, #[ignore]; our test fix TIP_CHANGE_TIMEOUT 1 s → 10 s)

### 11. spawn_notify_command_runs_shell_with_substituted_hash

- The test, as the results name it: zebrad components::notify::tests::spawn_notify_command_runs_shell_with_substituted_hash (#11865, a5e7ea8d54 → 9358963540)
- Here: reproduced, first failure after 20 min, replayed bit for bit
- before this work: never reproduced ("under load" only, #11861)
- test (fix): zebrad components::notify::tests::spawn_notify_command_runs_shell_with_substituted_hash (#11865, a5e7ea8d54 → 9358963540)

### 12. sync_one_checkpoint_mainnet

- The test, as the results name it: zebrad integration::sync::sync_one_checkpoint_mainnet (#11807, b2fd4ce06b → 4362d056d5; CI still retries it)
- Here: reproduced, first failure after 742 s (images were ready after 1 min), replayed bit for bit
- CI symptom: test child process deadline elapsed
- before this work: queue never ran it; stolen time 0/60, thread pauses 0
- test (fix): zebrad integration::sync::sync_one_checkpoint_mainnet (#11807, b2fd4ce06b → 4362d056d5; CI still retries it)
- reproduction: pre-fix commit: b2fd4ce06b
- reproduction: fix commit: 4362d056d5
- reproduction: fplus-dst: f+ DST

### 13. restart_stop_at_height

- The test, as the results name it: zebrad integration::sync::restart_stop_at_height (same fix)
- Here: reproduced, replayed bit for bit
- before this work: as Z7
- test (fix): zebrad integration::sync::restart_stop_at_height (same fix)

### 14. rate_limiting_drops_bursts

- The test, as the results name it: zebrad components::health::tests::rate_limiting_drops_bursts (#11966, 24e160ae6e → 6a3c337041)
- Here: reproduced, first failure after 4.0 min, replayed bit for bit
- CI symptom: requests should be dropped past threshold
- before this work: upstream: "not reproduced"; fixed preventively with an injected clock
- test (fix): zebrad components::health::tests::rate_limiting_drops_bursts (#11966, 24e160ae6e → 6a3c337041)

### 15. eviction_list_time_mixed

- The test, as the results name it: zebrad components::mempool::storage::tests::prop::eviction_list_time_mixed (same fix)
- Here: reproduced, first failure after 2.0 min, replayed bit for bit
- before this work: upstream: "not reproduced"
- test (fix): zebrad components::mempool::storage::tests::prop::eviction_list_time_mixed (same fix)
