Shut down Codex threads after approval scenarios (#33441)

## What changed

- Explicitly shut down and wait for each approval scenario's Codex thread.
- Preserve and return the scenario verification result after shutdown, so cleanup also runs when verification returns an error.

GitOrigin-RevId: 78dfbe657700a47b457ea9abd5efec4edd8f8a25
This commit is contained in:
jif
2026-07-15 22:27:36 +00:00
committed by copyberry
parent 365d70203d
commit 08924bca00
+3 -3
View File
@@ -2000,9 +2000,9 @@ async fn run_scenario(scenario: &ScenarioSpec) -> Result<()> {
"approval scenario {} result: exit_code={:?} stdout={:?}",
scenario.name, result.exit_code, result.stdout
);
scenario.expectation.verify(&test, &result)?;
Ok(())
let verification_result = scenario.expectation.verify(&test, &result);
test.codex.shutdown_and_wait().await?;
verification_result
}
#[tokio::test(flavor = "current_thread")]