mirror of
https://github.com/openai/codex.git
synced 2026-04-27 16:15:09 +00:00
test(core): stabilize ARM bazel remote-model and parallelism tests (#11330)
## Summary - keep wiremock MockServer handles alive through async assertions in remote model suite tests - assert /models request count in remote_models_hide_picker_only_models - use a slightly higher parallel timing threshold on aarch64 while keeping existing x86 threshold ## Validation - just fmt - targeted tests: - cargo test -p codex-core --test all suite::remote_models::remote_models_merge_replaces_overlapping_model -- --exact - cargo test -p codex-core --test all suite::remote_models::remote_models_hide_picker_only_models -- --exact - cargo test -p codex-core --test all suite::tool_parallelism::shell_tools_run_in_parallel -- --exact - soak loop: 40 iterations of all three targeted tests ## Notes - cargo test -p codex-core has one unrelated local-env failure in shell_snapshot::tests::try_new_creates_and_deletes_snapshot_file from exported certificate env content in this workspace. - local bazel test //codex-rs/core:core-all-test failed to build due missing rust-objcopy in this host toolchain.
This commit is contained in:
@@ -578,6 +578,8 @@ async fn remote_models_merge_adds_new_high_priority_first() -> Result<()> {
|
||||
1,
|
||||
"expected a single /models request"
|
||||
);
|
||||
// Keep the mock server alive until after async assertions complete.
|
||||
drop(server);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -634,6 +636,8 @@ async fn remote_models_merge_replaces_overlapping_model() -> Result<()> {
|
||||
1,
|
||||
"expected a single /models request"
|
||||
);
|
||||
// Keep the mock server alive until after async assertions complete.
|
||||
drop(server);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -644,7 +648,7 @@ async fn remote_models_merge_preserves_bundled_models_on_empty_response() -> Res
|
||||
skip_if_sandbox!(Ok(()));
|
||||
|
||||
let server = MockServer::start().await;
|
||||
let models_mock = mount_models_once(&server, ModelsResponse { models: Vec::new() }).await;
|
||||
let _models_mock = mount_models_once(&server, ModelsResponse { models: Vec::new() }).await;
|
||||
|
||||
let codex_home = TempDir::new()?;
|
||||
let mut config = load_default_config_for_test(&codex_home).await;
|
||||
@@ -669,11 +673,8 @@ async fn remote_models_merge_preserves_bundled_models_on_empty_response() -> Res
|
||||
available.iter().any(|model| model.model == bundled_slug),
|
||||
"bundled models should remain available after empty remote response"
|
||||
);
|
||||
assert_eq!(
|
||||
models_mock.requests().len(),
|
||||
1,
|
||||
"expected a single /models request"
|
||||
);
|
||||
// Keep the mock server alive until after async assertions complete.
|
||||
drop(server);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -753,7 +754,7 @@ async fn remote_models_hide_picker_only_models() -> Result<()> {
|
||||
|
||||
let server = MockServer::start().await;
|
||||
let remote_model = test_remote_model("codex-auto-balanced", ModelVisibility::Hide, 0);
|
||||
mount_models_once(
|
||||
let models_mock = mount_models_once(
|
||||
&server,
|
||||
ModelsResponse {
|
||||
models: vec![remote_model],
|
||||
@@ -789,6 +790,13 @@ async fn remote_models_hide_picker_only_models() -> Result<()> {
|
||||
.find(|model| model.model == "codex-auto-balanced")
|
||||
.expect("hidden remote model should be listed");
|
||||
assert!(!hidden.show_in_picker, "hidden models should remain hidden");
|
||||
assert_eq!(
|
||||
models_mock.requests().len(),
|
||||
1,
|
||||
"expected a single /models request"
|
||||
);
|
||||
// Keep the mock server alive until after async assertions complete.
|
||||
drop(server);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user