Skip to content

fix: flaky task test#1581

Merged
ruben-arts merged 1 commit intoprefix-dev:mainfrom
tdejager:fix/flaky-test
Jul 8, 2024
Merged

fix: flaky task test#1581
ruben-arts merged 1 commit intoprefix-dev:mainfrom
tdejager:fix/flaky-test

Conversation

@tdejager
Copy link
Copy Markdown
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
Comment thread tests/task_tests.rs
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
Copy Markdown
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
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