diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-07-24 17:00:56 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-07-24 17:00:56 +0200 |
commit | 1ffbeefff7f3817e2dec72ec06c2f139dbaca7ac (patch) | |
tree | d04de5a7cb2112437d23192545872a906ac2deaf | |
parent | feat(crates/yt/commands/cache): Init (diff) | |
download | yt-1ffbeefff7f3817e2dec72ec06c2f139dbaca7ac.zip |
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.
-rw-r--r-- | crates/yt/tests/_testenv/run.rs | 3 | ||||
-rw-r--r-- | 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"]); |