Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Stabilize the cloud environment HTTP test (#36732)

jif87e2d41eb3b1
diff --git a/codex-rs/cloud-tasks/src/env_detect_tests.rs b/codex-rs/cloud-tasks/src/env_detect_tests.rs
index 032438322e..6032806f07 100644
--- a/codex-rs/cloud-tasks/src/env_detect_tests.rs
+++ b/codex-rs/cloud-tasks/src/env_detect_tests.rs
@@ -33,7 +33,7 @@ async fn production_http_forwards_headers_and_decodes_response() {
.set_nonblocking(true)
.expect("environment HTTP listener should become nonblocking");
let server = std::thread::spawn(move || {
- let deadline = Instant::now() + Duration::from_secs(2);
+ let deadline = Instant::now() + Duration::from_secs(10);
let (mut stream, _) = loop {
match listener.accept() {
Ok(connection) => break connection,
@@ -48,7 +48,10 @@ async fn production_http_forwards_headers_and_decodes_response() {
}
};
stream
- .set_read_timeout(Some(Duration::from_secs(2)))
+ .set_nonblocking(false)
+ .expect("environment HTTP stream should become blocking");
+ stream
+ .set_read_timeout(Some(Duration::from_secs(10)))
.expect("environment HTTP stream should get a read timeout");
let mut request = Vec::new();
let mut buffer = [0_u8; 1024];
@@ -83,7 +86,7 @@ async fn production_http_forwards_headers_and_decodes_response() {
HeaderMap::from_iter([(AUTHORIZATION, HeaderValue::from_static("Bearer real-token"))]);
let selection = tokio::time::timeout(
- Duration::from_secs(2),
+ Duration::from_secs(10),
autodetect_environment_id_with_origins(
&http,
&base_url,