mirror of
https://github.com/openai/codex.git
synced 2026-09-15 12:08:01 +00:00
tests: use safe fast windows command in compact remote test
This commit is contained in:
@@ -234,9 +234,9 @@ async fn remote_compact_trims_function_call_history_to_fit_context_window() -> R
|
||||
let trimmed_call_id = "trimmed-call";
|
||||
let retained_command = "echo retained-shell-output";
|
||||
let trimmed_command = if cfg!(windows) {
|
||||
"for ($i=1; $i -le 3000; $i++) { Write-Output $i }"
|
||||
format!("echo {}", "x".repeat(7_000))
|
||||
} else {
|
||||
"yes x | head -n 3000"
|
||||
"yes x | head -n 3000".to_string()
|
||||
};
|
||||
|
||||
let harness = TestCodexHarness::with_builder(
|
||||
@@ -301,24 +301,14 @@ async fn remote_compact_trims_function_call_history_to_fit_context_window() -> R
|
||||
final_output_json_schema: None,
|
||||
})
|
||||
.await?;
|
||||
wait_for_event_with_timeout(
|
||||
&codex,
|
||||
|event| matches!(event, EventMsg::TurnComplete(_)),
|
||||
Duration::from_secs(30),
|
||||
)
|
||||
.await;
|
||||
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
|
||||
|
||||
let compact_mock =
|
||||
responses::mount_compact_json_once(harness.server(), serde_json::json!({ "output": [] }))
|
||||
.await;
|
||||
|
||||
codex.submit(Op::Compact).await?;
|
||||
wait_for_event_with_timeout(
|
||||
&codex,
|
||||
|event| matches!(event, EventMsg::TurnComplete(_)),
|
||||
Duration::from_secs(30),
|
||||
)
|
||||
.await;
|
||||
wait_for_event(&codex, |event| matches!(event, EventMsg::TurnComplete(_))).await;
|
||||
|
||||
assert!(
|
||||
response_log
|
||||
|
||||
Reference in New Issue
Block a user