vinteumorg / Floresta

A fully-validating Bitcoin node powered by Utreexo, with an integrated Electrum Server
MIT License
167 stars 36 forks source link

Error running tests #151

Closed joaothallis closed 5 months ago

joaothallis commented 5 months ago

My setup: OS: Ubuntu 22.04.4 LTS x86_64 Kernel: 5.15.0-105-generic Intel i7-10610U (8) @ 4.900GHz

cargo version
cargo 1.74.1 (ecb9851af 2023-10-18)

Steps:

cargo build --release --bin florestad
cargo test
warning: skipping duplicate package `embedded` found at `/home/joao/.cargo/git/checkouts/rust-bitcoin-ee9cd636efadd047/eb5d7a3/hashes/embedded`
   Compiling libc v0.2.153
   Compiling syn v2.0.58
   Compiling cc v1.0.92
   Compiling futures v0.1.31
   Compiling hex-conservative v0.1.1
   Compiling concurrent-queue v2.4.0
   Compiling typenum v1.17.0
   Compiling bitcoin v0.31.0 (https://github.com/Davidson-Souza/rust-bitcoin?rev=eb5d7a3896fff0ebf6394dabc882d46e439695be#eb5d7a38)
   Compiling generic-array v0.14.7
   Compiling bech32 v0.10.0-beta
   Compiling parking_lot_core v0.8.6
   Compiling ryu v1.0.17
   Compiling instant v0.1.12
   Compiling fastrand v2.0.2
   Compiling serde_json v1.0.115
   Compiling rustix v0.38.32
   Compiling linux-raw-sys v0.4.13
   Compiling syn v1.0.109
   Compiling num_cpus v1.16.0
   Compiling event-listener v4.0.3
   Compiling parking_lot v0.11.2
   Compiling secp256k1-sys v0.9.2
   Compiling bitcoinconsensus v0.20.2-0.5.0
   Compiling cpufeatures v0.2.12
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling crc32fast v1.4.0
   Compiling bitcoin-private v0.1.0
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling event-listener-strategy v0.4.0
   Compiling spin v0.9.8
   Compiling thiserror v1.0.58
   Compiling ppv-lite86 v0.2.17
   Compiling byteorder v1.5.0
   Compiling fxhash v0.2.1
   Compiling async-lock v3.3.0
   Compiling fs2 v0.4.3
   Compiling futures-lite v2.3.0
   Compiling event-listener v5.3.0
   Compiling crossbeam-epoch v0.9.18
   Compiling io-lifetimes v1.0.11
   Compiling sled v0.34.7
   Compiling event-listener-strategy v0.5.1
   Compiling bitcoin_hashes v0.12.0
   Compiling polling v2.8.0
   Compiling rustix v0.37.27
   Compiling event-listener v2.5.3
   Compiling serde_derive v1.0.197
   Compiling futures-macro v0.3.30
   Compiling thiserror-impl v1.0.58
   Compiling async-task v4.7.0
   Compiling atomic-waker v1.1.2
   Compiling piper v0.2.1
   Compiling polling v3.6.0
   Compiling futures-util v0.3.30
   Compiling async-channel v2.2.0
   Compiling socket2 v0.4.10
   Compiling async-io v1.13.0
   Compiling bitflags v1.3.2
   Compiling waker-fn v1.1.1
   Compiling linux-raw-sys v0.3.8
   Compiling fastrand v1.9.0
   Compiling futures-lite v1.13.0
   Compiling blocking v1.5.1
   Compiling async-io v2.3.2
   Compiling async-executor v1.10.0
   Compiling async-lock v2.8.0
   Compiling getrandom v0.2.14
   Compiling parking_lot_core v0.9.9
   Compiling serde v1.0.197
   Compiling futures-executor v0.3.30
   Compiling futures v0.3.30
   Compiling rand_core v0.6.4
   Compiling async-global-executor v2.4.1
   Compiling async-attributes v1.1.2
   Compiling async-channel v1.9.0
   Compiling kv-log-macro v1.0.7
   Compiling bytes v1.6.0
   Compiling rand_chacha v0.3.1
   Compiling async-std v1.12.0
   Compiling rustreexo v0.1.0
   Compiling core2 v0.4.0
   Compiling pkg-config v0.3.30
   Compiling parking_lot v0.12.1
   Compiling rand v0.8.5
   Compiling tokio-macros v2.2.0
   Compiling signal-hook-registry v1.4.1
   Compiling socket2 v0.5.6
   Compiling mio v0.8.11
   Compiling hex v0.4.3
   Compiling fnv v1.0.7
   Compiling bitcoin-internals v0.2.0
   Compiling bitcoin_hashes v0.13.0
   Compiling toml v0.5.11
   Compiling tinyvec_macros v0.1.1
   Compiling tinyvec v1.6.0
   Compiling http v0.2.12
   Compiling tokio v1.37.0
   Compiling dns-lookup v1.0.8
   Compiling httparse v1.8.0
   Compiling kv v0.24.0
   Compiling secp256k1 v0.28.2
   Compiling equivalent v1.0.1
   Compiling hashbrown v0.14.3
   Compiling oneshot v0.1.6
   Compiling unicode-normalization v0.1.23
   Compiling try-lock v0.2.5
   Compiling unicode-bidi v0.3.15
   Compiling want v0.3.1
   Compiling http-body v0.4.6
   Compiling indexmap v2.2.6
   Compiling vcpkg v0.2.15
   Compiling httpdate v1.0.3
   Compiling tower-service v0.3.2
   Compiling getrandom v0.1.16
   Compiling utf8parse v0.2.1
   Compiling anstyle-parse v0.2.3
   Compiling anstyle v1.0.6
   Compiling colorchoice v1.0.0
   Compiling anstyle-query v1.0.2
   Compiling lazy_static v1.4.0
   Compiling anstream v0.6.13
   Compiling secp256k1-sys v0.8.1
   Compiling strsim v0.11.1
   Compiling clap_lex v0.7.0
   Compiling foreign-types-shared v0.1.1
   Compiling anyhow v1.0.81
   Compiling openssl-sys v0.9.102
   Compiling heck v0.5.0
   Compiling openssl v0.10.64
   Compiling clap_derive v4.5.4
   Compiling foreign-types v0.3.2
   Compiling clap_builder v4.5.2
   Compiling rand_core v0.5.1
   Compiling jsonrpc-core v18.0.0
   Compiling openssl-macros v0.1.1
   Compiling native-tls v0.2.11
   Compiling tokio-util v0.7.10
   Compiling rand_chacha v0.2.2
   Compiling h2 v0.3.26
   Compiling clap v4.5.4
   Compiling unicase v2.7.0
   Compiling aho-corasick v1.1.3
   Compiling percent-encoding v2.3.1
   Compiling miniscript v11.0.0
   Compiling cfg_aliases v0.1.1
   Compiling hyper v0.14.28
   Compiling matches v0.1.10
   Compiling floresta-common v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-common)
   Compiling openssl-probe v0.1.5
   Compiling bitcoin v0.30.2
   Compiling regex-syntax v0.8.3
   Compiling floresta-watch-only v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-watch-only)
   Compiling idna v0.1.5
   Compiling nix v0.28.0
   Compiling secp256k1 v0.27.0
   Compiling regex-automata v0.4.6
   Compiling form_urlencoded v1.2.1
   Compiling rand v0.7.3
   Compiling zstd-sys v2.0.10+zstd.1.5.6
   Compiling bstr v1.9.1
   Compiling num-traits v0.2.18
   Compiling percent-encoding v1.0.1
   Compiling convert_case v0.4.0
   Compiling bech32 v0.9.1
   Compiling url v1.7.2
   Compiling jsonrpc-pubsub v18.0.0
   Compiling derive_more v0.99.17
   Compiling globset v0.4.14
   Compiling tokio-native-tls v0.3.1
   Compiling tokio-util v0.6.10
   Compiling tokio-stream v0.1.15
   Compiling idna v0.5.0
   Compiling is-terminal v0.4.12
   Compiling cfg-if v0.1.10
   Compiling base64 v0.21.7
   Compiling proc-macro-crate v0.1.5
   Compiling rustls-pemfile v1.0.4
   Compiling net2 v0.2.39
   Compiling colored v1.9.4
   Compiling url v2.5.0
   Compiling jsonrpc-server-utils v18.0.0
   Compiling miniscript v10.0.0
   Compiling hyper-tls v0.5.0
   Compiling jsonrpc-client-transports v18.0.0
   Compiling serde_urlencoded v0.7.1
   Compiling dirs-sys v0.3.7
   Compiling encoding_rs v0.8.33
   Compiling mime v0.3.17
   Compiling iana-time-zone v0.1.60
   Compiling sync_wrapper v0.1.2
   Compiling ipnet v2.9.0
   Compiling zstd-safe v6.0.6
   Compiling ctrlc v3.4.4
   Compiling chrono v0.4.37
   Compiling dirs v4.0.0
   Compiling jsonrpc-core-client v18.0.0
   Compiling jsonrpc-derive v18.0.0
   Compiling jsonrpc-http-server v18.0.0
   Compiling reqwest v0.11.27
   Compiling fern v0.6.2
   Compiling diff v0.1.13
   Compiling latest v0.1.1
   Compiling yansi v0.5.1
   Compiling floresta-chain v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-chain)
   Compiling pretty_assertions v1.4.0
   Compiling tempfile v3.10.1
   Compiling floresta-cli v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-cli)
   Compiling floresta-wire v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-wire)
   Compiling floresta-compact-filters v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-compact-filters)
   Compiling zstd v0.12.4
warning: struct `ReqwestConfig` is never constructed
  --> crates/floresta-cli/src/reqwest_client.rs:15:12
   |
15 | pub struct ReqwestConfig {
   |            ^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: associated functions `new` and `new_with_config` are never used
  --> crates/floresta-cli/src/reqwest_client.rs:24:12
   |
23 | impl ReqwestClient {
   | ------------------ associated functions in this implementation
24 |     pub fn new(url: String) -> Self {
   |            ^^^
...
31 |     pub fn new_with_config(config: ReqwestConfig) -> Self {
   |            ^^^^^^^^^^^^^^^

warning: `floresta-cli` (bin "floresta-cli" test) generated 2 warnings
   Compiling floresta-electrum v0.1.0 (/home/joao/Projects/Floresta/crates/floresta-electrum)
   Compiling florestad v0.5.1 (/home/joao/Projects/Floresta/florestad)
   Compiling floresta v0.1.0 (/home/joao/Projects/Floresta/crates/floresta)
warning: use of deprecated method `bitcoin::Block::strippedsize`: use Block::base_size() instead
   --> florestad/src/json_rpc/server.rs:378:41
    |
378 |                     strippedsize: block.strippedsize(),
    |                                         ^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: `florestad` (lib) generated 1 warning
warning: `florestad` (lib test) generated 1 warning (1 duplicate)
warning: `florestad` (bin "florestad" test) generated 1 warning (1 duplicate)
    Finished test [unoptimized + debuginfo] target(s) in 1m 56s
     Running unittests src/lib.rs (target/debug/deps/floresta-458519f5c59201a2)

running 0 tests

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

     Running unittests src/lib.rs (target/debug/deps/floresta_chain-ba5f9b27e7a973c2)

running 10 tests
test pruned_utreexo::chain_state::test::test_calc_next_work_required ... ok
test pruned_utreexo::partial_chain::tests::test_with_invalid_block ... ok
test pruned_utreexo::udata::test::test_spk_recovery ... ok
test test::test_network ... ok
test pruned_utreexo::udata::test::test_reconstruct_leaf_data ... ok
test pruned_utreexo::partial_chain::tests::test_updating_single_chain ... ok
test pruned_utreexo::partial_chain::tests::test_updating_multiple_chains ... ok
test pruned_utreexo::chain_state::test::test_reorg ... ok
test pruned_utreexo::chain_state::test::accept_first_signet_headers ... ok
test pruned_utreexo::chain_state::test::accept_mainnet_headers ... ok

test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 22.19s

     Running unittests src/lib.rs (target/debug/deps/floresta_cli-7064cbf3de43361c)

running 11 tests
test tests::test_get_block ... FAILED
test tests::test_get_block_hash ... FAILED
test tests::test_get_block_filter ... FAILED
test tests::test_get_block_header ... FAILED
test tests::test_load_descriptor ... FAILED
test tests::test_get_blockchaininfo ... FAILED
test tests::test_send_raw_transaction ... FAILED
test tests::test_get_height ... FAILED
test tests::test_rescan ... FAILED
test tests::test_stop ... FAILED
test tests::test_get_roots ... FAILED

failures:

---- tests::test_get_block stdout ----
thread 'tests::test_get_block' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::test_get_block_hash stdout ----
thread 'tests::test_get_block_hash' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_get_block_filter stdout ----
thread 'tests::test_get_block_filter' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_get_block_header stdout ----
thread 'tests::test_get_block_header' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_load_descriptor stdout ----
thread 'tests::test_load_descriptor' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_get_blockchaininfo stdout ----
thread 'tests::test_get_blockchaininfo' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_send_raw_transaction stdout ----
thread 'tests::test_send_raw_transaction' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_get_height stdout ----
thread 'tests::test_get_height' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_rescan stdout ----
thread 'tests::test_rescan' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_stop stdout ----
thread 'tests::test_stop' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

---- tests::test_get_roots stdout ----
thread 'tests::test_get_roots' panicked at crates/floresta-cli/src/lib.rs:76:14:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }

failures:
    tests::test_get_block
    tests::test_get_block_filter
    tests::test_get_block_hash
    tests::test_get_block_header
    tests::test_get_blockchaininfo
    tests::test_get_height
    tests::test_get_roots
    tests::test_load_descriptor
    tests::test_rescan
    tests::test_send_raw_transaction
    tests::test_stop

test result: FAILED. 0 passed; 11 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass `-p floresta-cli --lib`

I am not running florestad but for what I see in the CI, it is only require to build

Running with log_to_file as false returns the same error

joaothallis commented 5 months ago

I was solved running cargo build, its being documented here: https://github.com/Davidson-Souza/Floresta/pull/154