Skip to content

test-suite isolation #966

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

Merged
merged 2 commits into from
Aug 6, 2023
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
21 changes: 12 additions & 9 deletions gix-worktree/tests/worktree/checkout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ fn keep_going_collects_results() {
}

if multi_threaded() {
assert_eq!(dir_structure(&destination).len(), 3);
let actual = dir_structure(&destination);
assert!(
(2..=3).contains(&actual.len()),
"it's 3 most of the time, but can be 2 of the 'empty' file is missing as the object couldn't be accessed.\
It's unclear why there isn't more, as it would keep going"
);
} else {
assert_eq!(
stripped_prefix(&destination, &dir_structure(&destination)),
Expand Down Expand Up @@ -350,10 +355,9 @@ fn collisions_are_detected_on_a_case_insensitive_filesystem_even_with_delayed_fi

let dest_files = dir_structure(&destination);
if multi_threaded() {
assert_eq!(
dest_files.len(),
5,
"can only assert on number as it's racily creating files so unclear which one clashes"
assert!(
(4..=6).contains(&dest_files.len()),
"due to the clash happening at nearly any time, and keep-going is false, we get a variance of files"
);
} else {
assert_eq!(
Expand All @@ -370,10 +374,9 @@ fn collisions_are_detected_on_a_case_insensitive_filesystem_even_with_delayed_fi
let error_kind_dir = error_kind;

if multi_threaded() {
assert_eq!(
outcome.collisions.len(),
5,
"can only assert on number as it's racily creating files so unclear which one clashes"
assert!(
(5..=6).contains(&outcome.collisions.len()),
"can only assert on number as it's racily creating files so unclear which one clashes, and due to keep-going = false there is variance"
);
} else {
assert_eq!(
Expand Down
3 changes: 3 additions & 0 deletions tests/tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,16 @@ fn configure_command<'a>(
args: &[String],
script_result_directory: &Path,
) -> &'a mut std::process::Command {
let never_path = if cfg!(windows) { "-" } else { ":" };
cmd.args(args)
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.current_dir(script_result_directory)
.env_remove("GIT_DIR")
.env_remove("GIT_ASKPASS")
.env_remove("SSH_ASKPASS")
.env("GIT_CONFIG_SYSTEM", never_path)
.env("GIT_CONFIG_GLOBAL", never_path)
.env("GIT_TERMINAL_PROMPT", "false")
.env("GIT_AUTHOR_DATE", "2000-01-01 00:00:00 +0000")
.env("GIT_AUTHOR_EMAIL", "[email protected]")
Expand Down