bitcoindevkit / bitcoindevkit/rust-esplora-client
ci: debug flaky CI failures
- Dominant language
- Rust
- Stars
- 56
- Forks
- 75
- Avg merge
- 19h 8m
- Merged PRs (30d)
- 4
Description
e.g.: https://github.com/bitcoindevkit/rust-esplora-client/actions/runs/30694292738
```
running 12 tests
test test_get_block_by_hash ... FAILED
test test_get_block_info ... ok
test test_get_block_by_hash_not_existing ... ok
test test_get_block_infos ... ok
test test_get_block_status ... ok
test test_get_block_txs ... ok
test test_get_header_by_hash ... ok
test test_get_block_txids ... ok
test test_get_non_existing_block_status ... ok
test test_get_merkle_block ... ok
test test_get_txid_at_block_index ... ok
test testenv::test::test_that_errors_are_propagated ... ok
failures:
---- test_get_block_by_hash stdout ----
thread 'test_get_block_by_hash' (35402) panicked at tests/testenv/mod.rs:183:68:
called `Result::unwrap()` on an `Err` value: IOError(Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" })
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/31fca3adb283cc9dfd56b49cdee9a96eb9c96ffd/library/std/src/panicking.rs:689:5
1: core::panicking::panic_fmt
at /rustc/31fca3adb283cc9dfd56b49cdee9a96eb9c96ffd/library/core/src/panicking.rs:80:14
2: core::result::unwrap_failed
at /rustc/31fca3adb283cc9dfd56b49cdee9a96eb9c96ffd/library/core/src/result.rs:1867:5
3: core::result::Result::unwrap
at /home/runner/.rustup/toolchains/1.96.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1233:23
4: block::testenv::TestEnv::wait_until_electrum_sees_block
at ./tests/testenv/mod.rs:183:68
5: block::testenv::TestEnv::new_with_config
at ./tests/testenv/mod.rs:136:13
6: block::testenv::TestEnv::new
at ./tests/testenv/mod.rs:88:9
7: block::test_get_block_by_hash::{{closure}}
at ./tests/block.rs:94:15
8: as core::future::future::Future>::poll
at /home/runner/.rustup/toolchains/1.96.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/future.rs:133:9
9: as core::future::future::Future>::poll
at /home/runner/.rustup/toolchains/1.96.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/future.rs:133:9
10: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:778:70
11: tokio::task::coop::with_budget
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/task/coop/mod.rs:167:5
12: tokio::task::coop::budget
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/task/coop/mod.rs:133:5
13: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:778:25
14: tokio::runtime::scheduler::current_thread::Context::enter
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:451:19
15: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:777:44
16: tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:865:68
17: tokio::runtime::context::scoped::Scoped::set
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/context/scoped.rs:40:9
18: tokio::runtime::context::set_scheduler::{{closure}}
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/context.rs:181:38
19: std::thread::local::LocalKey::try_with
at /home/runner/.rustup/toolchains/1.96.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:462:12
20: std::thread::local::LocalKey::with
at /home/runner/.rustup/toolchains/1.96.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:426:20
21: tokio::runtime::context::set_scheduler
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/context.rs:181:17
22: tokio::runtime::scheduler::current_thread::CoreGuard::enter
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:865:27
23: tokio::runtime::scheduler::current_thread::CoreGuard::block_on
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:765:24
24: tokio::runtime::scheduler::current_thread::CurrentThread::block_on::{{closure}}
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:205:33
25: tokio::runtime::context::runtime::enter_runtime
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/context/runtime.rs:65:16
26: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/scheduler/current_thread/mod.rs:193:9
27: tokio::runtime::runtime::Runtime::block_on_inner
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/runtime.rs:371:52
28: tokio::runtime::runtime::Runtime::block_on
at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.52.1/src/runtime/runtime.rs:345:18
29: block::test_get_block_by_hash
at ./tests/block.rs:109:38
30: block::test_get_block_by_hash::{{closure}}
at ./tests/block.rs:93:34
31: core::ops::function::FnOnce::call_once
at /home/runner/.rustup/toolchains/1.96.1-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
32: core::result::Result<(), alloc::string::String> as core::ops::function::FnOnce<()>>::call_once
at /rustc/31fca3adb283cc9dfd56b49cdee9a96eb9c96ffd/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
test_get_block_by_hash
test result: FAILED. 11 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.05s
error: test failed, to rerun pass `--test block`
Error running tests: command exited with non-zero code `cargo --locked test --no-default-features --features "async-https-native blocking-https-native tokio"`: 101
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with tests/testenv/mod.rs, especially wait_until_electrum_sees_block at line 183, and the test_get_block_by_hash setup in tests/block.rs. Reproduce it with the shown cargo test command, then trace the connection-reset failure. Done means the CI test no longer fails intermittently and test_get_block_by_hash completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, ci-cd, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100