为什么使用 actix-lua 的测试线程崩溃但测试永远不会完成?

我正在使用 actix-lua crate 进行测试:

#[should_panic]
#[test]
fn lua_actor_user_error() {
    let system = System::new("test");

    let lua_addr = lua_actor_with_handle(
        r#"
    print("before")
    error("foo")
    print("after")
    "#,
    )
    .start();

    let l = lua_addr.send(LuaMessage::from(0));
    let fut = async move {
        let res = l.await;
        match res {
            Ok(_res) => {
                // it should panic.
                // and it does, but it seems the test does not pass
                // running 1 test
                // thread 'actor::tests::lua_actor_user_error' panicked at ... src/actor.rs:205:31
                System::current().stop();
            }
            Err(e) => {
                println!("actor dead {}", e);
            }
        };
    };
    Arbiter::spawn(fut);

    system.run();
}

我可以从输出中看到崩溃按预期发生:

running 1 test
before
thread 'actor::tests::lua_actor_user_error' panicked at 'RuntimeError("[string \"Prelude\"]:35: [string \"handle\"]:3: foo\nstack traceback:\n\t[C]: in ?\n\t[C]: in function \'error\'\n\t[string \"Prelude\"]:35: in function \'__run\'")', src/actor.rs:205:31

涉及的代码。

测试永远不会完成。我错过了什么吗?

点赞