You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m currently writing a unit test for a simple async function that performs some string manipulation. When I run the function in my actual application using cargo run, it completes in about 1 second — as expected.
However, when I run the same function in a unit test (using #[tokio::test] or block_on), the test takes around 40 seconds to complete. I’m puzzled as to why there’s such a huge difference in runtime between the normal execution and the test environment.
Any advice, insight, or debugging tips would be greatly appreciated!
Thanks in advance! 🙏
The text was updated successfully, but these errors were encountered:
For general Rust discussions (not specific to the Rust projects in this repo), consider asking on URLO or in the Community Discord or on zulip. The rust-lang/rust issue tracker is meant for specific issues pertaining to the language, compiler, rustdoc, and other projects living in this repo, but is not meant for general Rust discussions.
Hello Rustaceans! 👋
I’m currently writing a unit test for a simple async function that performs some string manipulation. When I run the function in my actual application using cargo run, it completes in about 1 second — as expected.
However, when I run the same function in a unit test (using #[tokio::test] or block_on), the test takes around 40 seconds to complete. I’m puzzled as to why there’s such a huge difference in runtime between the normal execution and the test environment.
Any advice, insight, or debugging tips would be greatly appreciated!
Thanks in advance! 🙏
The text was updated successfully, but these errors were encountered: