mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
fix unified_exec::tests::unified_exec_timeouts to use a more unique match value (#9414)
Fix unified_exec_timeouts to use a unique variable value rather than "codex" which was causing false positives when running tests locally (presumably from my bash prompts). Discovered while running tests to validate another change. Fixes https://github.com/openai/codex/issues/9413 Test Plan: Ran test locally on my fedora 43 x86_64 machine with: ``` cd codex/cargo-rs cargo nextest run --all-features --no-fail-fast unified_exec::tests::unified_exec_timeouts ``` Before, unified_exec_timeouts fails: ``` Finished `test` profile [unoptimized + debuginfo] target(s) in 0.38s ──────────── Nextest run ID fa2b4949-a66c-408c-8002-32c52c70ec4f with nextest profile: default Starting 1 test across 107 binaries (3211 tests skipped) FAIL [ 5.667s] codex-core unified_exec::tests::unified_exec_timeouts stdout ─── running 1 test test unified_exec::tests::unified_exec_timeouts ... FAILED failures: failures: unified_exec::tests::unified_exec_timeouts test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 774 filtered out; finished in 5.66s stderr ─── thread 'unified_exec::tests::unified_exec_timeouts' (459601) panicked at core/src/unified_exec/mod.rs:381:9: timeout too short should yield incomplete output note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ──────────── Summary [ 5.677s] 1 test run: 0 passed, 1 failed, 3211 skipped FAIL [ 5.667s] codex-core unified_exec::tests::unified_exec_timeouts error: test run failed ``` After, works: ``` Finished `test` profile [unoptimized + debuginfo] target(s) in 0.34s ──────────── Nextest run ID f49e9004-e30b-4049-b0ff-283b543a1cd7 with nextest profile: default Starting 1 test across 107 binaries (3211 tests skipped) SLOW [> 15.000s] codex-core unified_exec::tests::unified_exec_timeouts PASS [ 17.666s] codex-core unified_exec::tests::unified_exec_timeouts ──────────── Summary [ 17.676s] 1 test run: 1 passed (1 slow), 3211 skipped ```
This commit is contained in:
@@ -354,6 +354,8 @@ mod tests {
|
||||
async fn unified_exec_timeouts() -> anyhow::Result<()> {
|
||||
skip_if_sandbox!(Ok(()));
|
||||
|
||||
const TEST_VAR_VALUE: &str = "unified_exec_var_123";
|
||||
|
||||
let (session, turn) = test_session_and_turn().await;
|
||||
|
||||
let open_shell = exec_command(&session, &turn, "bash -i", 2_500).await?;
|
||||
@@ -366,7 +368,7 @@ mod tests {
|
||||
write_stdin(
|
||||
&session,
|
||||
process_id,
|
||||
"export CODEX_INTERACTIVE_SHELL_VAR=codex\n",
|
||||
format!("export CODEX_INTERACTIVE_SHELL_VAR={TEST_VAR_VALUE}\n").as_str(),
|
||||
2_500,
|
||||
)
|
||||
.await?;
|
||||
@@ -379,7 +381,7 @@ mod tests {
|
||||
)
|
||||
.await?;
|
||||
assert!(
|
||||
!out_2.output.contains("codex"),
|
||||
!out_2.output.contains(TEST_VAR_VALUE),
|
||||
"timeout too short should yield incomplete output"
|
||||
);
|
||||
|
||||
@@ -388,7 +390,7 @@ mod tests {
|
||||
let out_3 = write_stdin(&session, process_id, "", 100).await?;
|
||||
|
||||
assert!(
|
||||
out_3.output.contains("codex"),
|
||||
out_3.output.contains(TEST_VAR_VALUE),
|
||||
"subsequent poll should retrieve output"
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user