Can I get a stacktrace of a running unit test in cargo test in GitHub Actions?

This is a question involving probably both cargo test and GitHub Actions.

When GitHub Actions runs CI for my Rust project, sometimes (not always) it fails due to one unit test timing out:

test foo::tests::test_bar has been running for over 60 seconds
Error: The operation was canceled.

(RUST_BACKTRACE = 1)

Is there a way to instruct cargo or GitHub, or both, to capture a stacktrace of the running test which caused the error? The goal is to find out how / where this test case got stuck.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.