Skip to content

Commit ea41717

Browse files
committed
Make proxy error-path test independent of TCP refusal timing.
The streaming, credentials, and logging assertions had already passed. The failure occurred in the final check, which expected HTTP 502 after reconnecting to a closed upstream port. The test assumes connection refusal completes quickly. Windows TCP retry behavior can exceed the test's two-second deadline. Both the client and proxy use that deadline, so the client can time out before receiving an error response. Linux and macOS passed in the linked run. The local upstream fixture now accepts the final request and closes without responding, producing an upstream error without depending on connection-refusal timing. See: https://github.com/asimov-platform/asimov-sdk/actions/runs/37508505937/job/112423220048
1 parent b20e8ba commit ea41717

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎rust/TODO.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ reproductions and build results are distinguished from source-review findings.
6161

6262
## P2: Build, feature, and facade correctness
6363

64+
- [ ] **Confirm the proxy HTTP 502 fixture fix on Windows CI.**
65+
Run 37508505937 timed out while reconnecting to a closed upstream port in
66+
`lib/asimov-proxy/src/openai.rs`. The fixture now accepts and closes the final
67+
request without responding; local tests pass on macOS.
68+
6469
- [ ] **Make the no-std contract hold on a target without std.**
6570
Host `--no-default-features` checks pass, but `asimov-core` fails for
6671
`thumbv7em-none-eabihf`: default-enabled `know` pulls `serde_json/std` and

‎rust/lib/asimov-proxy/src/openai.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ mod tests {
356356
.write_all(b"e\r\ndata: second\n\n\r\n0\r\n\r\n")
357357
.await
358358
.unwrap();
359+
drop(socket);
360+
361+
// Close the next request without a response to trigger HTTP 502.
362+
// Connecting to a closed port can outlast the deadline on Windows.
363+
let (mut socket, _) = upstream.accept().await.unwrap();
364+
read_request_headers(&mut socket).await;
359365
});
360366

361367
// Use a local cleartext upstream to exercise the entire serving path.
@@ -433,11 +439,11 @@ mod tests {
433439
.unwrap()
434440
.contains("data: second")
435441
);
436-
upstream_task.await.unwrap();
437442

438-
// The completed upstream listener is gone; errors become HTTP 502.
443+
// The upstream closes without responding; errors become HTTP 502.
439444
let failed = client.get(&url).send().await.unwrap();
440445
assert_eq!(failed.status(), StatusCode::BAD_GATEWAY);
446+
upstream_task.await.unwrap();
441447
stop.send(()).unwrap();
442448
tokio::time::timeout(Duration::from_secs(2), server)
443449
.await

0 commit comments

Comments
 (0)