about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-24 17:00:56 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-24 17:00:56 +0200
commit1ffbeefff7f3817e2dec72ec06c2f139dbaca7ac (patch)
treed04de5a7cb2112437d23192545872a906ac2deaf
parentfeat(crates/yt/commands/cache): Init (diff)
downloadyt-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.rs3
-rw-r--r--crates/yt/tests/subscriptions/import_export/mod.rs1
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"]);