@@ -190,7 +190,9 @@ where
190190/// This is more flexible than `run_crash_test_with_artifacts` and allows for:
191191/// - Custom binary selection (e.g., crashing_test_app instead of crashtracker_bin_test)
192192/// - Custom command arguments
193- /// - Custom exit status expectations
193+ ///
194+ /// Note: This function always expects the test to crash (exit with non-success status).
195+ /// All current uses of this function test crash scenarios, not successful exits.
194196///
195197/// # Example
196198/// ```no_run
@@ -223,7 +225,6 @@ where
223225/// .arg(&artifacts_map[&receiver])
224226/// .arg(&fixtures.output_dir);
225227/// },
226- /// false, // expect crash (not success)
227228/// |payload, _fixtures| {
228229/// // Custom validation
229230/// Ok(())
@@ -235,7 +236,6 @@ where
235236pub fn run_custom_crash_test < CB , V > (
236237 binary_path : & std:: path:: Path ,
237238 command_builder : CB ,
238- expect_success : bool ,
239239 validator : V ,
240240) -> Result < ( ) >
241241where
@@ -251,13 +251,10 @@ where
251251
252252 let exit_status = crate :: timeit!( "exit after signal" , { p. wait( ) ? } ) ;
253253
254- // Validate exit status
255- let actual_success = exit_status. success ( ) ;
254+ // Validate exit status - custom crash tests always expect failure
256255 anyhow:: ensure!(
257- expect_success == actual_success,
258- "Exit status mismatch: expected success={}, got success={} (exit code: {:?})" ,
259- expect_success,
260- actual_success,
256+ !exit_status. success( ) ,
257+ "Expected test to crash (non-success exit), but it succeeded with code: {:?}" ,
261258 exit_status. code( )
262259 ) ;
263260
0 commit comments