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

Racy failures in test_wrappers #61

Closed
cuviper opened this issue Apr 25, 2024 · 0 comments · Fixed by #62
Closed

Racy failures in test_wrappers #61

cuviper opened this issue Apr 25, 2024 · 0 comments · Fixed by #62

Comments

@cuviper
Copy link
Owner

cuviper commented Apr 25, 2024

This assertion occasionally fails:

// Finally, make sure that `RUSTC_WRAPPER` is applied outermost
// by using something that doesn't pass through at all.
env::set_var("RUSTC_WRAPPER", "/bin/true");
env::set_var("RUSTC_WORKSPACE_WRAPPER", "/bin/false");
let ac = autocfg::AutoCfg::new().unwrap();
assert!(ac.probe_type("mesize")); // anything goes!

I found that the probe sometimes gets an EPIPE when writing input to the child process. In this particular test scenario, the dummy /bin/true wrapper may exit too quickly, closing its stdin before we had a chance to write anything (which it wasn't going to look at anyway).

I don't think it's wrong for the library to consider that a failed probe, but I'd like to make the test more robust.

cuviper added a commit that referenced this issue May 2, 2024
* New-type the possibly-wrapped `rustc` commands.
* Use wrappers when reading the version -- fixes #58.
* Test with a wrapper script that reads input -- fixes #61.
cuviper added a commit that referenced this issue May 3, 2024
* New-type the possibly-wrapped `rustc` commands.
* Use wrappers when reading the version -- fixes #58.
* Test with a wrapper script that reads input -- fixes #61.
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.

1 participant