Skip to content
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

Cannot create several tests #44

Closed
NinoLipartiia4ire opened this issue Dec 29, 2021 · 2 comments · Fixed by #46
Closed

Cannot create several tests #44

NinoLipartiia4ire opened this issue Dec 29, 2021 · 2 comments · Fixed by #46

Comments

@NinoLipartiia4ire
Copy link

If you try running several separate tests with a sandboxed environment for the first time, at least one of them fails.

See an example: NinoLipartiia4ire/workspaces-rs-example@33a479d.
Both tests from this example should pass. But if you run them:

git clone https://github.com/NinoLipartiia4ire/workspaces-rs-example
cd workspaces-rs-example/tests-workspaces-rs && cargo test

Either one of them fails:

test second_test ... ok
test first_test ... FAILED

failures:

---- first_test stdout ----
Starting up sandbox at localhost:24842
thread 'first_test' panicked at 'called `Result::unwrap()` on an `Err` value: Directory not empty (os error 66)', /Users/nino/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/workspaces-0.1.0/src/network/sandbox.rs:43:24

Or both tests fail:

test second_test ... FAILED
test first_test ... FAILED

failures:

---- second_test stdout ----
Starting up sandbox at localhost:22402
thread 'second_test' panicked at 'called `Result::unwrap()` on an `Err` value: /Users/nino/projects/issue-workspaces-rs/workspaces-rs-example/tests-workspaces-rs/target/debug/build/near-sandbox-utils-0a71fab0dd1ce1e6/out/near-sandbox-8b3f59a31cb9016b/near-sandbox is not executable', /Users/nino/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/workspaces-0.1.0/src/network/sandbox.rs:43:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- first_test stdout ----
Starting up sandbox at localhost:17497
thread 'first_test' panicked at 'called `Result::unwrap()` on an `Err` value: No such file or directory (os error 2)', /Users/nino/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/workspaces-0.1.0/src/network/sandbox.rs:43:24

Running cargo test for the second time and later doesn't return any error, both tests pass.

To reproduce this bug again: cargo clean && cargo test.

@ChaoticTempest
Copy link
Member

I think I see the issue here. There was a race condition when installing the binary, so this should be fixed with this PR #46

@mikedotexe
Copy link

Given the last comment, I think I'll close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants