Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11345-sandbox-buildrs-env-race.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**test(perry): the two `sandbox_buildrs` wrap-cargo tests no longer race on `PERRY_SANDBOX_BUILDRS`.** One removed the variable while the other set it, on parallel test threads. Both now hold `test_env_lock::env_lock()`.
2 changes: 2 additions & 0 deletions crates/perry/src/commands/compile/sandbox_buildrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ mod tests {
#[test]
fn wrap_cargo_falls_through_when_sandbox_disabled() {
// Sandbox off → just `cargo`.
let _env = crate::test_env_lock::env_lock();
let ctx = CompilationContext::new(std::path::PathBuf::from("/tmp"));
std::env::remove_var("PERRY_SANDBOX_BUILDRS");
let cmd = wrap_cargo_command(&ctx, "demo");
Expand All @@ -258,6 +259,7 @@ mod tests {
fn wrap_cargo_falls_through_when_package_exempt() {
let mut ctx = CompilationContext::new(std::path::PathBuf::from("/tmp"));
ctx.allow_unsandboxed_build.push("demo".to_string());
let _env = crate::test_env_lock::env_lock();
std::env::set_var("PERRY_SANDBOX_BUILDRS", "1");
let cmd = wrap_cargo_command(&ctx, "demo");
std::env::remove_var("PERRY_SANDBOX_BUILDRS");
Expand Down
Loading