From 1ffbeefff7f3817e2dec72ec06c2f139dbaca7ac Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 24 Jul 2025 17:00:56 +0200 Subject: test(crates/yt/testenv/run/run_piped): Finalize the second command after the first one Otherwise, we introduce a race condition and thus produce spurious test failures. --- crates/yt/tests/_testenv/run.rs | 3 +-- crates/yt/tests/subscriptions/import_export/mod.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/yt/tests/_testenv/run.rs b/crates/yt/tests/_testenv/run.rs index 85c914f..4df9362 100644 --- a/crates/yt/tests/_testenv/run.rs +++ b/crates/yt/tests/_testenv/run.rs @@ -83,7 +83,6 @@ impl TestEnv { let mut first_child = first_cmd.spawn().expect("yt spawn"); second_cmd.stdin(first_child.stdout.take().expect("Was set")); - let second_output = Self::finalize_cmd(second_cmd, second_args); let first_output = first_child.wait_with_output().expect("yt run"); assert!( @@ -92,7 +91,7 @@ impl TestEnv { format_exit_error(first_args, &first_output) ); - second_output + Self::finalize_cmd(second_cmd, second_args) } /// Run *yt*, with the given args. diff --git a/crates/yt/tests/subscriptions/import_export/mod.rs b/crates/yt/tests/subscriptions/import_export/mod.rs index 911f09f..44d3b8b 100644 --- a/crates/yt/tests/subscriptions/import_export/mod.rs +++ b/crates/yt/tests/subscriptions/import_export/mod.rs @@ -16,6 +16,7 @@ fn test_import_export() { ]); let before = env.run(&["subs", "list"]); + env.assert_output(&["subs", "list"], include_str!("./golden.txt")); env.run_piped(&["subs", "export"], &["subs", "import", "--force"]); -- cgit 1.4.1