-
Notifications
You must be signed in to change notification settings - Fork 76
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
WebAssembly Support #124
Comments
This is awesome! I don't think the implementation looks that janky actually, I understand the implementation requirements around Tokio's default I/O channels ( One thing though, it looks like if we enable tracing, we're back onto the tokio runtime? I feel like maybe in WASM it would make sense to just ignore the tracing configuration bit and not spawn anything named (as it's really only a feature for Does everything work as expected? The tests all pass on a WASM runtime? You can also try out the examples and benchmarks to see how it does! If we clean it up a bit, this would be a great PR :) |
Failing to execute however with timer problems in Node.js ```log $ wasm-pack test --node [INFO]: 🎯 Checking for the Wasm target... Finished dev [unoptimized + debuginfo] target(s) in 0.24s [INFO]: ⬇️ Installing wasm-bindgen... Finished test [unoptimized + debuginfo] target(s) in 0.22s Running unittests src/lib.rs (/Users/seanlawlor/src/slawlor_ractor/target/wasm32-unknown-unknown/debug/deps/ractor-fd4d272b3d05cda5.wasm) Set timeout to 20 seconds... running 54 tests panicked at 'time not implemented on this platform', library/std/src/sys/wasm/../unsupported/time.rs:31:9 ``` Related to Issue #124 - Adding WASM support
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
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
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
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
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
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
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
To update here, the problem I ran into is WASM is always panic=abort. Which means to get WASM running, even at all, we're going to need to ignore all the tests where a panic occurs since it can't be captured ever. I have a prelim PR, but I don't have enough time to go through and exclude all the failing logic (or migrate the test-cases to not use panics when possible). If anyone wants to pick this up, it's a great use-case and I'd love to see it move on. PR #175 will need to be rebased and probably some merge conflicts resolved, but it should be the bulk of the concurrency runtime necessary to get this working. |
Is your feature request related to a problem? Please describe.
Ractor seems to be very close to capable of running in a WASM environment, even a browser one. It would be amazing to have an actor system that could be used client- and server-side in a Rust app.
Describe the solution you'd like
I was able to get ractor running in the browser very very simply and with minimal changes over at https://github.com/tekacs/ractor/tree/wasm-support from master by using the WIP swappable runtimes in
concurrency.rs
.The implementation is janky and a little incorrect, but mostly works and does the job nicely. Making this more correct and validating tests would be the next step.
I would love to incorporate such changes into upstream ractor to make it possible to keep going with an approach like this in the longer term.
Describe alternatives you've considered
I currently have a custom client-side actor system in my WASM environments... it would be nice to unify things under the banner of ractor.
The text was updated successfully, but these errors were encountered: