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

fix: flaky task test #1581

Merged
merged 1 commit into from
Jul 8, 2024
Merged

fix: flaky task test #1581

merged 1 commit into from
Jul 8, 2024

Conversation

tdejager
Copy link
Contributor

@tdejager tdejager commented Jul 8, 2024

Fix for flaky task test, not using remove_var because of: https://doc.rust-lang.org/std/env/fn.remove_var.html

Even though this function is currently not marked as unsafe, it needs to be because invoking it can cause undefined behaviour. The function will be marked unsafe in a future version of Rust. This is tracked in rust#27970.

This function is safe to call in a single-threaded program.

In multi-threaded programs, you must ensure that are no other threads concurrently writing or reading(!) from the environment through functions other than the ones in this module. You are responsible for figuring out how to achieve this, but we strongly suggest not using set_var or remove_var in multi-threaded programs at all.

@tdejager tdejager requested a review from wolfv July 8, 2024 12:57
@@ -282,3 +281,6 @@ async fn test_clean_env() {
assert_eq!(result.exit_code, 0);
assert_eq!(result.stdout, "Hello is: world from env\n");
}

// When adding another test with an environment variable, please choose a unique name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol good catch!

@ruben-arts ruben-arts merged commit ed16690 into prefix-dev:main Jul 8, 2024
24 checks passed
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 this pull request may close these issues.

3 participants