Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed test bind_ipv4_ipv6::case_2 #1305

Open
amakeenk opened this issue Jan 7, 2024 · 2 comments
Open

Failed test bind_ipv4_ipv6::case_2 #1305

amakeenk opened this issue Jan 7, 2024 · 2 comments

Comments

@amakeenk
Copy link

amakeenk commented Jan 7, 2024

OS: ALT Regular x86_64
rust version: 1.75.0
miniserve version: 0.25.0

Steps to reproduce:
$ RUST_BACKTRACE=full cargo test --test bind

Result:

running 13 tests
test bind_fails::case_1 ... ok
test bind_fails::case_2 ... ok
test bind_ipv4_ipv6::case_1 ... ok
test validate_printed_urls::case_1 ... ok
test validate_printed_urls::case_2 ... ok
test validate_printed_urls::case_3 ... ok
test validate_printed_urls::case_4 ... ok
test bind_ipv4_ipv6::case_3 ... ok
test bind_ipv4_ipv6::case_4 ... ok
test validate_printed_urls::case_5 ... ok
test validate_printed_urls::case_6 ... ok
test validate_printed_urls::case_7 ... ok
test bind_ipv4_ipv6::case_2 ... FAILED

failures:

---- bind_ipv4_ipv6::case_2 stdout ----
thread 'bind_ipv4_ipv6::case_2' panicked at tests/fixtures/mod.rs:152:13:
timeout waiting for port 35257
stack backtrace:
   0:     0x55792858ee8c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4115c290c944b935
   1:     0x5579285abdcd - core::fmt::write::hd184e5699806b34c
   2:     0x55792856f50f - std::io::Write::write_fmt::hbef719a5f4cbfd4c
   3:     0x55792858ec72 - std::sys_common::backtrace::print::heff2358bb8b6d2d1
   4:     0x5579285914a5 - std::panicking::default_hook::{{closure}}::h5651721bac752c02
   5:     0x5579285911c7 - std::panicking::default_hook::h531ccdfc928a8628
   6:     0x557927be2197 - test::test_main::{{closure}}::ha304499cabe8e82c
   7:     0x557928591a4f - std::panicking::rust_panic_with_hook::h7524dc9b87702142
   8:     0x5579285917ae - std::panicking::begin_panic_handler::{{closure}}::hf713b86cf3c64e64
   9:     0x55792858f2c6 - std::sys_common::backtrace::__rust_end_short_backtrace::h54ef28bbeccade42
  10:     0x557928591512 - rust_begin_unwind
  11:     0x557927bb9c45 - core::panicking::panic_fmt::hf9a98c5547cf0437
  12:     0x557927bbf72b - bind::fixtures::wait_for_port::ha31cac8f3c451c09
                               at /home/amakeenk/gear/miniserve/tests/fixtures/mod.rs:152:13
  13:     0x557927bbe427 - bind::fixtures::server::hc1efb39a39dcaecd
                               at /home/amakeenk/gear/miniserve/tests/fixtures/mod.rs:112:5
  14:     0x557927bc8163 - bind::bind_ipv4_ipv6::case_2::hc7bdec9f5a13189c
                               at /home/amakeenk/gear/miniserve/tests/bind.rs:29:8
  15:     0x557927bbd1c7 - bind::bind_ipv4_ipv6::case_2::{{closure}}::h5262a1e6a081e9ad
                               at /home/amakeenk/gear/miniserve/tests/bind.rs:36:6
  16:     0x557927bc0756 - core::ops::function::FnOnce::call_once::ha8b12f5bed11de51
                               at /usr/src/RPM/BUILD/rust-1.75.0/library/core/src/ops/function.rs:250:5
  17:     0x557927be6c9f - test::__rust_begin_short_backtrace::h93e7afbacb40f5ec
  18:     0x557927be113e - test::types::RunnableTest::run::h324438ee0173adb7
  19:     0x557927be5d46 - test::run_test::{{closure}}::h37459229a8020335
  20:     0x557927bc9806 - std::sys_common::backtrace::__rust_begin_short_backtrace::hee99b4f0a3935f39
  21:     0x557927bcfb37 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h826d0adc7cabf22b
  22:     0x557928594a05 - std::sys::unix::thread::Thread::new::thread_start::hee21f521fdcb4044
  23:     0x7f37bb89392b - <unknown>
  24:     0x7f37bb915cb8 - <unknown>
  25:                0x0 - <unknown>


failures:
    bind_ipv4_ipv6::case_2

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

Manual startup on the same port works correctly:

$ miniserve -p 35257 .
miniserve v0.25.0
Bound to [::]:35257, 0.0.0.0:35257
@svenstaro
Copy link
Owner

Might be a race condition when running the tests. Does it work if you rerun it a few times or if you run the tests single threaded?

@amakeenk
Copy link
Author

amakeenk commented Jan 7, 2024

Does not work in both cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants