Skip to content

Commit

Permalink
Some early prototyping to get wasm support for Ractor
Browse files Browse the repository at this point in the history
Present status: We have most of the plubming in-place, however the runtime
is getting a panic when issuing a `sleep` operation.

Reproduce with

1. Installing Node.js
2. Running: `$ wasm-pack test --node -- -- test_pg_monitoring`

Output:
```
[INFO]: 🎯  Checking for the Wasm target...
   Compiling ractor v0.9.3 (/Users/seanlawlor/src/slawlor_ractor/ractor)
    Finished dev [unoptimized + debuginfo] target(s) in 1.70s
[INFO]: ⬇️  Installing wasm-bindgen...
   Compiling ractor v0.9.3 (/Users/seanlawlor/src/slawlor_ractor/ractor)
    Finished test [unoptimized + debuginfo] target(s) in 1.59s
     Running unittests src/lib.rs (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/debug/deps/ractor-44740482816e2f08.wasm)
Set timeout to 20 seconds...
running 44 tests

ERROR ractor/src/common_test.rs:24 PRE_SLEEP
panicked at 'called `Result::unwrap()` on an `Err` value: JsValue(Error: expected a number argument
Error: expected a number argument
    at _assertNum (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:238:39)
    at /Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:482:5
    at handleError (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:261:18)
    at module.exports.__wbg_setTimeout_fba1b48a90e30862 (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:480:72)
    at wasmtimer::js::GlobalScope::set_timeout_with_callback_and_timeout_and_arguments_0::hb00afdc7d7fa7e9b (wasm://wasm/02af6976:wasm-function[6527]:0x60b69f)
    at wasmtimer::js::set_timeout::hb4e14bbfc2d09317 (wasm://wasm/02af6976:wasm-function[14118]:0x73a46e)
    at wasmtimer::timer::global::schedule_callback::ha21e55b3c0d863d7 (wasm://wasm/02af6976:wasm-function[5487]:0x5c8603)
    at wasmtimer::timer::global::run::h0b7b9c4227a88003 (wasm://wasm/02af6976:wasm-function[3886]:0x5451a9)
    at <wasmtimer::timer::TimerHandle as core::default::Default>::default::hdd4fb80ebee06da7 (wasm://wasm/02af6976:wasm-function[3042]:0x4eb6d5)
    at wasmtimer::tokio::sleep::Sleep::new_at::h944492fbfbde8a7a (wasm://wasm/02af6976:wasm-function[14322]:0x73f43a))', /Users/seanlawlor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtimer-0.2.0/src/timer/global.rs:85:6

Stack:

Error
    at /Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:664:17
    at logError (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:223:18)
    at module.exports.__wbg_new_abda76e883ba8a5f (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:663:65)
    at console_error_panic_hook::Error::new::h7964f208bc5ab187 (wasm://wasm/02af6976:wasm-function[20146]:0x7afa1b)
    at console_error_panic_hook::hook_impl::haa20ccab0a21c777 (wasm://wasm/02af6976:wasm-function[3835]:0x540001)
    at console_error_panic_hook::hook::h27c28657be0a81ea (wasm://wasm/02af6976:wasm-function[22361]:0x7cd06e)
    at core::ops::function::Fn::call::h0fdeed15ae9d43e6 (wasm://wasm/02af6976:wasm-function[19268]:0x7a1f54)
    at std::panicking::rust_panic_with_hook::he017c20114c82dea (wasm://wasm/02af6976:wasm-function[7919]:0x65af0f)
    at std::panicking::begin_panic_handler::{{closure}}::h5e23c6f065badef5 (wasm://wasm/02af6976:wasm-function[10127]:0x6bf1b7)
    at std::sys_common::backtrace::__rust_end_short_backtrace::hff4b03aa315e3d86 (wasm://wasm/02af6976:wasm-function[26263]:0x7eb8ac)

test ractor::pg::tests::test_pg_monitoring ... FAIL

failures:

---- ractor::pg::tests::test_pg_monitoring output ----
    log output:
        %cERROR%c ractor/src/common_test.rs:24%c PRE_SLEEP color: red; background: #444 color: gray; font-style: italic color: inherit

    error output:
        panicked at 'called `Result::unwrap()` on an `Err` value: JsValue(Error: expected a number argument
        Error: expected a number argument
            at _assertNum (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:238:39)
            at /Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:482:5
            at handleError (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:261:18)
            at module.exports.__wbg_setTimeout_fba1b48a90e30862 (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:480:72)
            at wasmtimer::js::GlobalScope::set_timeout_with_callback_and_timeout_and_arguments_0::hb00afdc7d7fa7e9b (wasm://wasm/02af6976:wasm-function[6527]:0x60b69f)
            at wasmtimer::js::set_timeout::hb4e14bbfc2d09317 (wasm://wasm/02af6976:wasm-function[14118]:0x73a46e)
            at wasmtimer::timer::global::schedule_callback::ha21e55b3c0d863d7 (wasm://wasm/02af6976:wasm-function[5487]:0x5c8603)
            at wasmtimer::timer::global::run::h0b7b9c4227a88003 (wasm://wasm/02af6976:wasm-function[3886]:0x5451a9)
            at <wasmtimer::timer::TimerHandle as core::default::Default>::default::hdd4fb80ebee06da7 (wasm://wasm/02af6976:wasm-function[3042]:0x4eb6d5)
            at wasmtimer::tokio::sleep::Sleep::new_at::h944492fbfbde8a7a (wasm://wasm/02af6976:wasm-function[14322]:0x73f43a))', /Users/seanlawlor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtimer-0.2.0/src/timer/global.rs:85:6

        Stack:

        Error
            at /Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:664:17
            at logError (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:223:18)
            at module.exports.__wbg_new_abda76e883ba8a5f (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/wbg-tmp-ractor-44740482816e2f08.wasm/wasm-bindgen-test.js:663:65)
            at console_error_panic_hook::Error::new::h7964f208bc5ab187 (wasm://wasm/02af6976:wasm-function[20146]:0x7afa1b)
            at console_error_panic_hook::hook_impl::haa20ccab0a21c777 (wasm://wasm/02af6976:wasm-function[3835]:0x540001)
            at console_error_panic_hook::hook::h27c28657be0a81ea (wasm://wasm/02af6976:wasm-function[22361]:0x7cd06e)
            at core::ops::function::Fn::call::h0fdeed15ae9d43e6 (wasm://wasm/02af6976:wasm-function[19268]:0x7a1f54)
            at std::panicking::rust_panic_with_hook::he017c20114c82dea (wasm://wasm/02af6976:wasm-function[7919]:0x65af0f)
            at std::panicking::begin_panic_handler::{{closure}}::h5e23c6f065badef5 (wasm://wasm/02af6976:wasm-function[10127]:0x6bf1b7)
            at std::sys_common::backtrace::__rust_end_short_backtrace::hff4b03aa315e3d86 (wasm://wasm/02af6976:wasm-function[26263]:0x7eb8ac)

    JS exception that was thrown:
        RuntimeError: unreachable
            at __rust_start_panic (wasm://wasm/02af6976:wasm-function[26312]:0x7eb9ca)
            at rust_panic (wasm://wasm/02af6976:wasm-function[26139]:0x7eb2bd)
            at std::panicking::rust_panic_with_hook::he017c20114c82dea (wasm://wasm/02af6976:wasm-function[7919]:0x65af3c)
            at std::panicking::begin_panic_handler::{{closure}}::h5e23c6f065badef5 (wasm://wasm/02af6976:wasm-function[10127]:0x6bf1b7)
            at std::sys_common::backtrace::__rust_end_short_backtrace::hff4b03aa315e3d86 (wasm://wasm/02af6976:wasm-function[26263]:0x7eb8ac)
            at rust_begin_unwind (wasm://wasm/02af6976:wasm-function[15991]:0x763dce)
            at core::panicking::panic_fmt::h7859ddfa497c0e61 (wasm://wasm/02af6976:wasm-function[20866]:0x7b9ce8)
            at core::result::unwrap_failed::h99b8d970e94e9f11 (wasm://wasm/02af6976:wasm-function[11508]:0x6ef54b)
            at core::result::Result<T,E>::unwrap::h0dd97648d8128ba5 (wasm://wasm/02af6976:wasm-function[11740]:0x6f6d0e)
            at wasmtimer::timer::global::schedule_callback::ha21e55b3c0d863d7 (wasm://wasm/02af6976:wasm-function[5487]:0x5c8620)

failures:

    ractor::pg::tests::test_pg_monitoring

test result: FAILED. 0 passed; 1 failed; 43 ignored

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

Caused by:
  process didn't exit successfully: `/Users/seanlawlor/Library/Caches/.wasm-pack/wasm-bindgen-cargo-install-0.2.87/wasm-bindgen-test-runner /Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/debug/deps/ractor-44740482816e2f08.wasm test_pg_monitoring` (exit status: 1)
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit status: 1
  full command: cd "/Users/seanlawlor/src/slawlor_ractor/ractor" && CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER="/Users/seanlawlor/Library/Caches/.wasm-pack/wasm-bindgen-cargo-install-0.2.87/wasm-bindgen-test-runner" WASM_BINDGEN_TEST_ONLY_NODE="1" "cargo" "test" "--target" "wasm32-unknown-unknown" "--" "test_pg_monitoring"
```

Related to Issue #124 - Adding WASM support
  • Loading branch information
slawlor committed Oct 13, 2023
1 parent c593b4c commit d49d7c6
Show file tree
Hide file tree
Showing 26 changed files with 411 additions and 134 deletions.
29 changes: 25 additions & 4 deletions ractor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ rust-version = "1.64"
### Other features
cluster = []

# default = ["async-std"]
default = []

[dependencies]
Expand All @@ -26,23 +25,45 @@ async-trait = "0.1"
dashmap = "5"
futures = "0.3"
once_cell = "1"
rand = "0.8"

# Tracing feature requires --cfg=tokio_unstable
tokio = { version = "1", features = ["sync", "time", "rt", "macros", "tracing"] }
async-std = { version = "1", features = ["attributes"], optional = true}
tracing = { version = "0.1", features = ["attributes"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# TODO #124 - this is due to the temporary disabling of the "factory" module
rand = "0.8"

[target.'cfg(target_arch = "wasm32")'.dependencies]
# instant = { version = "0.1", features = ["wasm-bindgen"]}
getrandom = { version = "0.2", features = ["js"] }
parking_lot = { version = "0.11", features = ["wasm-bindgen"] }
wasm-timer = { version = "0.2" }
wasm-bindgen-futures = { version = "0.4"}
wasm-bindgen-test = "0.3"
wasmtimer = { version = "0.2", features = ["tokio"] }

[dev-dependencies]
criterion = "0.5"
backtrace = "0.3"
function_name = "0.3"
paste = "1"
rand = "0.8"
tokio = { version = "1", features = ["rt", "time", "sync", "macros", "rt-multi-thread", "tracing"] }
tracing-glog = "0.3"
tracing-subscriber = { version = "0.3", features = ["env-filter"]}

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
console_error_panic_hook = "0.1"
tokio = { version = "1", features = ["rt", "time", "sync", "macros"] }
tracing-wasm = "0.2"
wasm-bindgen = "0.2"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = "0.5"
tokio = { version = "1", features = ["rt", "time", "sync", "macros", "rt-multi-thread", "tracing"] }
tracing-test = "0.2"


[[bench]]
name = "actor"
harness = false
Expand Down
10 changes: 10 additions & 0 deletions ractor/benches/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
// This source code is licensed under both the MIT license found in the
// LICENSE-MIT file in the root directory of this source tree.

#[cfg(not(target_arch = "wasm32"))]
#[macro_use]
extern crate criterion;

#[cfg(not(target_arch = "wasm32"))]
use criterion::{BatchSize, Criterion};
#[cfg(feature = "cluster")]
use ractor::Message;
Expand Down Expand Up @@ -45,6 +47,7 @@ impl Actor for BenchActor {
}
}

#[cfg(not(target_arch = "wasm32"))]
fn create_actors(c: &mut Criterion) {
let small = 100;
let large = 10000;
Expand Down Expand Up @@ -130,6 +133,7 @@ fn create_actors(c: &mut Criterion) {
});
}

#[cfg(not(target_arch = "wasm32"))]
fn schedule_work(c: &mut Criterion) {
let small = 100;
let large = 1000;
Expand Down Expand Up @@ -239,6 +243,7 @@ fn schedule_work(c: &mut Criterion) {
});
}

#[cfg(not(target_arch = "wasm32"))]
#[allow(clippy::async_yields_async)]
fn process_messages(c: &mut Criterion) {
const NUM_MSGS: u64 = 100000;
Expand Down Expand Up @@ -328,5 +333,10 @@ fn process_messages(c: &mut Criterion) {
});
}

#[cfg(not(target_arch = "wasm32"))]
criterion_group!(actors, create_actors, schedule_work, process_messages);
#[cfg(not(target_arch = "wasm32"))]
criterion_main!(actors);

#[cfg(target_arch = "wasm32")]
fn main() {}
3 changes: 2 additions & 1 deletion ractor/examples/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ fn init_logging() {
tracing::subscriber::set_global_default(subscriber).expect("to set global subscriber");
}

#[tokio::main]
#[cfg_attr(not(target_arch = "wasm32"), tokio::main)]
#[cfg_attr(target_arch = "wasm32", tokio::main(flavor = "current_thread"))]
async fn main() {
init_logging();

Expand Down
3 changes: 2 additions & 1 deletion ractor/examples/monte_carlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ fn init_logging() {
tracing::subscriber::set_global_default(subscriber).expect("to set global subscriber");
}

#[tokio::main]
#[cfg_attr(not(target_arch = "wasm32"), tokio::main)]
#[cfg_attr(target_arch = "wasm32", tokio::main(flavor = "current_thread"))]
async fn main() {
init_logging();

Expand Down
3 changes: 2 additions & 1 deletion ractor/examples/output_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ fn init_logging() {
tracing::subscriber::set_global_default(subscriber).expect("to set global subscriber");
}

#[tokio::main]
#[cfg_attr(not(target_arch = "wasm32"), tokio::main)]
#[cfg_attr(target_arch = "wasm32", tokio::main(flavor = "current_thread"))]
async fn main() {
init_logging();

Expand Down
3 changes: 2 additions & 1 deletion ractor/examples/philosophers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,8 @@ fn init_logging() {
tracing::subscriber::set_global_default(subscriber).expect("to set global subscriber");
}

#[tokio::main]
#[cfg_attr(not(target_arch = "wasm32"), tokio::main)]
#[cfg_attr(target_arch = "wasm32", tokio::main(flavor = "current_thread"))]
async fn main() {
init_logging();

Expand Down
3 changes: 2 additions & 1 deletion ractor/examples/ping_pong.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ fn init_logging() {
tracing::subscriber::set_global_default(subscriber).expect("to set global subscriber");
}

#[tokio::main]
#[cfg_attr(not(target_arch = "wasm32"), tokio::main)]
#[cfg_attr(target_arch = "wasm32", tokio::main(flavor = "current_thread"))]
async fn main() {
init_logging();

Expand Down
3 changes: 2 additions & 1 deletion ractor/examples/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ fn init_logging() {
tracing::subscriber::set_global_default(subscriber).expect("to set global subscriber");
}

#[tokio::main]
#[cfg_attr(not(target_arch = "wasm32"), tokio::main)]
#[cfg_attr(target_arch = "wasm32", tokio::main(flavor = "current_thread"))]
async fn main() {
init_logging();

Expand Down
10 changes: 5 additions & 5 deletions ractor/src/actor/actor_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use std::any::TypeId;
use std::sync::Arc;

#[cfg(feature = "async-std")]
#[cfg(any(feature = "async-std", target_arch = "wasm32"))]
use futures::FutureExt;

use super::messages::{Signal, StopMessage};
Expand Down Expand Up @@ -110,7 +110,7 @@ impl ActorPortSet {
where
TState: crate::State,
{
#[cfg(feature = "async-std")]
#[cfg(any(feature = "async-std", target_arch = "wasm32"))]
{
crate::concurrency::select! {
// supervision or message processing work
Expand All @@ -124,7 +124,7 @@ impl ActorPortSet {
}
}
}
#[cfg(not(feature = "async-std"))]
#[cfg(not(any(feature = "async-std", target_arch = "wasm32")))]
{
crate::concurrency::select! {
// supervision or message processing work
Expand All @@ -149,7 +149,7 @@ impl ActorPortSet {
/// Returns [Ok(ActorPortMessage)] on a successful message reception, [MessagingErr]
/// in the event any of the channels is closed.
pub async fn listen_in_priority(&mut self) -> Result<ActorPortMessage, MessagingErr<()>> {
#[cfg(feature = "async-std")]
#[cfg(any(feature = "async-std", target_arch = "wasm32"))]
{
crate::concurrency::select! {
signal = self.signal_rx.recv().fuse() => {
Expand All @@ -166,7 +166,7 @@ impl ActorPortSet {
}
}
}
#[cfg(not(feature = "async-std"))]
#[cfg(not(any(feature = "async-std", target_arch = "wasm32")))]
{
crate::concurrency::select! {
signal = self.signal_rx.recv() => {
Expand Down
49 changes: 32 additions & 17 deletions ractor/src/actor/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ use crate::{
Actor, ActorCell, ActorProcessingErr, ActorRef, ActorStatus, SpawnErr, SupervisionEvent,
};

mod supervisor;
pub mod supervisor;

struct EmptyMessage;
#[cfg(feature = "cluster")]
impl crate::Message for EmptyMessage {}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 26 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L26

Added line #L26 was not covered by tests
async fn test_panic_on_start_captured() {
crate::common_test::setup();
struct TestActor;

#[async_trait::async_trait]
Expand All @@ -47,8 +48,9 @@ async fn test_panic_on_start_captured() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 51 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L51

Added line #L51 was not covered by tests
async fn test_error_on_start_captured() {
crate::common_test::setup();
struct TestActor;

#[async_trait::async_trait]
Expand All @@ -71,8 +73,9 @@ async fn test_error_on_start_captured() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 76 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L76

Added line #L76 was not covered by tests
async fn test_stop_higher_priority_over_messages() {
crate::common_test::setup();
let message_counter = Arc::new(AtomicU8::new(0u8));

struct TestActor {
Expand Down Expand Up @@ -150,8 +153,9 @@ async fn test_stop_higher_priority_over_messages() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 156 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L156

Added line #L156 was not covered by tests
async fn test_kill_terminates_work() {
crate::common_test::setup();
struct TestActor;

#[async_trait::async_trait]
Expand Down Expand Up @@ -196,8 +200,9 @@ async fn test_kill_terminates_work() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 203 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L203

Added line #L203 was not covered by tests
async fn test_stop_does_not_terminate_async_work() {
crate::common_test::setup();
struct TestActor;

#[async_trait::async_trait]
Expand Down Expand Up @@ -251,8 +256,9 @@ async fn test_stop_does_not_terminate_async_work() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 259 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L259

Added line #L259 was not covered by tests
async fn test_kill_terminates_supervision_work() {
crate::common_test::setup();
struct TestActor;

#[async_trait::async_trait]
Expand Down Expand Up @@ -299,8 +305,9 @@ async fn test_kill_terminates_supervision_work() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 308 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L308

Added line #L308 was not covered by tests
async fn test_sending_message_to_invalid_actor_type() {
crate::common_test::setup();
struct TestActor1;
struct TestMessage1;
#[cfg(feature = "cluster")]
Expand Down Expand Up @@ -357,8 +364,9 @@ async fn test_sending_message_to_invalid_actor_type() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 367 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L367

Added line #L367 was not covered by tests
async fn test_sending_message_to_dead_actor() {
crate::common_test::setup();
struct TestActor;

#[async_trait::async_trait]
Expand Down Expand Up @@ -391,8 +399,9 @@ async fn test_sending_message_to_dead_actor() {

#[cfg(feature = "cluster")]
#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 402 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L402

Added line #L402 was not covered by tests
async fn test_serialized_cast() {
crate::common_test::setup();
use crate::message::{BoxedDowncastErr, SerializedMessage};
use crate::Message;

Expand Down Expand Up @@ -506,8 +515,9 @@ where

#[cfg(feature = "cluster")]
#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 518 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L518

Added line #L518 was not covered by tests
async fn test_serialized_rpc() {
crate::common_test::setup();
use crate::message::{BoxedDowncastErr, SerializedMessage};
use crate::{Message, RpcReplyPort};

Expand Down Expand Up @@ -616,8 +626,9 @@ async fn test_serialized_rpc() {

#[cfg(feature = "cluster")]
#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 629 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L629

Added line #L629 was not covered by tests
async fn test_remote_actor() {
crate::common_test::setup();
use crate::message::{BoxedDowncastErr, SerializedMessage};
use crate::{ActorId, ActorRuntime, Message};

Expand Down Expand Up @@ -725,8 +736,9 @@ async fn test_remote_actor() {

#[cfg(feature = "cluster")]
#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 739 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L739

Added line #L739 was not covered by tests
async fn spawning_local_actor_as_remote_fails() {
crate::common_test::setup();
use crate::ActorProcessingErr;

struct RemoteActor;
Expand Down Expand Up @@ -782,8 +794,9 @@ async fn spawning_local_actor_as_remote_fails() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]
async fn instant_spawns() {
crate::common_test::setup();
let counter = Arc::new(AtomicU8::new(0));

struct EmptyActor;
Expand Down Expand Up @@ -843,7 +856,7 @@ async fn instant_spawns() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 859 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L859

Added line #L859 was not covered by tests
async fn stop_and_wait() {
struct SlowActor;
#[async_trait::async_trait]
Expand Down Expand Up @@ -872,8 +885,9 @@ async fn stop_and_wait() {
}

#[crate::concurrency::test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 888 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L888

Added line #L888 was not covered by tests
async fn kill_and_wait() {
crate::common_test::setup();
struct SlowActor;
#[async_trait::async_trait]
impl Actor for SlowActor {
Expand Down Expand Up @@ -901,8 +915,9 @@ async fn kill_and_wait() {
}

#[test]
#[tracing_test::traced_test]
#[cfg_attr(not(target_arch = "wasm32"), tracing_test::traced_test)]

Check warning on line 918 in ractor/src/actor/tests/mod.rs

View check run for this annotation

Codecov / codecov/patch

ractor/src/actor/tests/mod.rs#L918

Added line #L918 was not covered by tests
fn test_err_map() {
crate::common_test::setup();
let err: RactorErr<i32> = RactorErr::Messaging(MessagingErr::SendErr(123));

let _: RactorErr<()> = err.map(|_| ());
Expand Down
Loading

0 comments on commit d49d7c6

Please sign in to comment.