macrotest icon indicating copy to clipboard operation
macrotest copied to clipboard

Parallel tests fail in workspace project

Open taqtiqa-mark opened this issue 3 years ago • 1 comments
trafficstars

Thank you for the effort you have put into making macrotest, and for making it open source.

I ran into this issue in the course of trying to isolate what appears to be unexpected behavior.

PR #72 proposes to add a workspace project example, and this error can be observed by checking out the first commit in the PR.

cd workspace-project
cargo test -- --nocapture

Should show these two results for parallel_1 and parallel_2 test cases:

tests/expand/second.rs - different!
Diff [lines: 6 added, 1 removed]:
--------------------------
 #[macro_use]
 extern crate test_project;
 pub fn main() {
+    {
+        let mut temp_vec = Vec::new();
+        temp_vec.push(1);
+        temp_vec
+    };
-    ();
 }
+
--------------------------



thread 'parallel_2' panicked at '1 of 1 tests failed', /home/user/src/macrotest/src/expand.rs:171:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test parallel_2 ... FAILED
tests/expand/first.rs - different!
Diff [lines: 2 added, 1 removed]:
--------------------------
 #[macro_use]
 extern crate test_project;
 pub fn main() {
+    Vec::new();
-    ();
 }
+
--------------------------



thread 'parallel_1' panicked at '1 of 1 tests failed', /home/user/src/macrotest/src/expand.rs:171:9
test parallel_1 ... FAILED

failures:

failures:
    parallel_1
    parallel_2

taqtiqa-mark avatar Mar 28 '22 04:03 taqtiqa-mark

Workaround for the test-project:

cargo test -- --test-threads=1

However, this does not workaround the issue in the test-virtual.

taqtiqa-mark avatar Mar 28 '22 05:03 taqtiqa-mark