Skip to content

process_spawned_and_wait_in_different_runtime test can fail #7671

@Darksonn

Description

@Darksonn

This failure was observed:

  stdout ───

    running 1 test
    test process_spawned_and_wait_in_different_runtime ... FAILED

    failures:

    ---- process_spawned_and_wait_in_different_runtime stdout ----
    ---- process_spawned_and_wait_in_different_runtime stderr ----


    failures:
        process_spawned_and_wait_in_different_runtime

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.32s
    
  stderr ───

    thread 'main' (10361) panicked at tokio/tests/process_change_of_runtime.rs:21:36:
    called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "A Tokio 1.x context was found, but it is being shutdown." }
    stack backtrace:
       0: __rustc::rust_begin_unwind
                 at /rustc/be0ade2b602bdfe37a3cc259fcc79e8624dcba94/library/std/src/panicking.rs:698:5
       1: core::panicking::panic_fmt
                 at /rustc/be0ade2b602bdfe37a3cc259fcc79e8624dcba94/library/core/src/panicking.rs:80:14
       2: core::result::unwrap_failed
                 at /rustc/be0ade2b602bdfe37a3cc259fcc79e8624dcba94/library/core/src/result.rs:1855:5
       3: core::result::Result<T,E>::unwrap
                 at /rustc/be0ade2b602bdfe37a3cc259fcc79e8624dcba94/library/core/src/result.rs:1226:23
       4: process_change_of_runtime::process_spawned_and_wait_in_different_runtime::{{closure}}
                 at ./tests/process_change_of_runtime.rs:21:36
       5: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
                 at ./src/runtime/park.rs:285:71
       6: tokio::task::coop::with_budget
                 at ./src/task/coop/mod.rs:167:5
       7: tokio::task::coop::budget
                 at ./src/task/coop/mod.rs:133:5
       8: tokio::runtime::park::CachedParkThread::block_on
                 at ./src/runtime/park.rs:285:31
       9: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
                 at ./src/runtime/context/blocking.rs:66:14
      10: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
                 at ./src/runtime/scheduler/multi_thread/mod.rs:87:22
      11: tokio::runtime::context::runtime::enter_runtime
                 at ./src/runtime/context/runtime.rs:65:16
      12: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
                 at ./src/runtime/scheduler/multi_thread/mod.rs:86:9
      13: tokio::runtime::runtime::Runtime::block_on_inner
                 at ./src/runtime/runtime.rs:370:50
      14: tokio::runtime::runtime::Runtime::block_on
                 at ./src/runtime/runtime.rs:342:18
      15: process_change_of_runtime::process_spawned_and_wait_in_different_runtime
                 at ./tests/process_change_of_runtime.rs:20:29
      16: process_change_of_runtime::process_spawned_and_wait_in_different_runtime::{{closure}}
                 at ./tests/process_change_of_runtime.rs:12:51
      17: core::ops::function::FnOnce::call_once
                 at /rustc/be0ade2b602bdfe37a3cc259fcc79e8624dcba94/library/core/src/ops/function.rs:250:5
      18: core::ops::function::FnOnce::call_once
                 at /rustc/be0ade2b602bdfe37a3cc259fcc79e8624dcba94/library/core/src/ops/function.rs:250:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

This probably highlights an error in the pidfd_reaper file. For example, maybe the try_wait() call should be updated to properly handle rt shutdown errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-bugCategory: This is a bug.M-processModule: tokio/process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions