Test failures #6

Closed
opened 2023-01-31 12:45:47 +00:00 by jpds · 2 comments
Contributor

The tests here seem to depend on basalt, which is an optional feature:

$ cargo test
   Compiling netapp v0.5.2 (/var/home/jdavies/git/lx/netapp)
error[E0432]: unresolved import `netapp::peering::basalt`
  --> examples/basalt.rs:18:22
   |
18 | use netapp::peering::basalt::*;
   |                      ^^^^^^ could not find `basalt` in `peering`

error[E0433]: failed to resolve: use of undeclared type `Basalt`
   --> examples/basalt.rs:111:15
    |
111 |     let basalt = Basalt::new(netapp.clone(), bootstrap_peers, basalt_params);
    |                  ^^^^^^ use of undeclared type `Basalt`

error[E0412]: cannot find type `Basalt` in this scope
  --> examples/basalt.rs:58:14
   |
56 | struct Example {
   |               - help: you might be missing a type parameter: `<Basalt>`
57 |     netapp: Arc<NetApp>,
58 |     basalt: Arc<Basalt>,
   |                 ^^^^^^ not found in this scope

error[E0422]: cannot find struct, variant or union type `BasaltParams` in this scope
   --> examples/basalt.rs:104:22
    |
104 |     let basalt_params = BasaltParams {
    |                         ^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0412, E0422, E0432, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `netapp` due to 4 previous errors

However, it then fails in a different way with the feature:

$ cargo test --features basalt
    Finished test [unoptimized + debuginfo] target(s) in 0.09s
     Running unittests src/lib.rs (target/debug/deps/netapp-464522c46aba3419)

running 3 tests
test bytes_buf::test::test_bytes_buf ... ok
test test::test_with_threaded_scheduler ... FAILED
test test::test_with_basic_scheduler ... ok

failures:

---- test::test_with_threaded_scheduler stdout ----
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/netapp.rs:198:61
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/netapp.rs:198:61
A pl1: []
thread 'test::test_with_threaded_scheduler' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `2`', src/test.rs:63:5


failures:
    test::test_with_threaded_scheduler

test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.03s

error: test failed, to rerun pass '--lib'

(I don't have any other services listening on this device but cups and systemd-resolved).

The tests here seem to depend on `basalt`, which is an optional feature: ``` $ cargo test Compiling netapp v0.5.2 (/var/home/jdavies/git/lx/netapp) error[E0432]: unresolved import `netapp::peering::basalt` --> examples/basalt.rs:18:22 | 18 | use netapp::peering::basalt::*; | ^^^^^^ could not find `basalt` in `peering` error[E0433]: failed to resolve: use of undeclared type `Basalt` --> examples/basalt.rs:111:15 | 111 | let basalt = Basalt::new(netapp.clone(), bootstrap_peers, basalt_params); | ^^^^^^ use of undeclared type `Basalt` error[E0412]: cannot find type `Basalt` in this scope --> examples/basalt.rs:58:14 | 56 | struct Example { | - help: you might be missing a type parameter: `<Basalt>` 57 | netapp: Arc<NetApp>, 58 | basalt: Arc<Basalt>, | ^^^^^^ not found in this scope error[E0422]: cannot find struct, variant or union type `BasaltParams` in this scope --> examples/basalt.rs:104:22 | 104 | let basalt_params = BasaltParams { | ^^^^^^^^^^^^ not found in this scope Some errors have detailed explanations: E0412, E0422, E0432, E0433. For more information about an error, try `rustc --explain E0412`. error: could not compile `netapp` due to 4 previous errors ``` However, it then fails in a different way with the feature: ``` $ cargo test --features basalt Finished test [unoptimized + debuginfo] target(s) in 0.09s Running unittests src/lib.rs (target/debug/deps/netapp-464522c46aba3419) running 3 tests test bytes_buf::test::test_bytes_buf ... ok test test::test_with_threaded_scheduler ... FAILED test test::test_with_basic_scheduler ... ok failures: ---- test::test_with_threaded_scheduler stdout ---- thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/netapp.rs:198:61 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', src/netapp.rs:198:61 A pl1: [] thread 'test::test_with_threaded_scheduler' panicked at 'assertion failed: `(left == right)` left: `0`, right: `2`', src/test.rs:63:5 failures: test::test_with_threaded_scheduler test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 12.03s error: test failed, to rerun pass '--lib' ``` (I don't have any other services listening on this device but `cups` and `systemd-resolved`).
Owner

The tests have to run with a single thread as follows : cargo test -- --test-threads 1, otherwise concurrent tests try to use the same port, that's the crash you observed.

Yes the Basalt test has to be removed when the feature flag is not activated.

The tests have to run with a single thread as follows : `cargo test -- --test-threads 1`, otherwise concurrent tests try to use the same port, that's the crash you observed. Yes the Basalt test has to be removed when the feature flag is not activated.
Author
Contributor

Merci.

Merci.
jpds closed this issue 2023-01-31 13:49:09 +00:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lx/netapp#6
No description provided.