mirror of
https://github.com/openai/codex.git
synced 2026-11-25 23:30:49 +00:00
Stabilize code-mode panic and process metrics tests (#63767)
## Why Formatting a panic backtrace can outlast the process metrics RPC deadline. A timed-out RPC can also hold the collector permit before its worker starts, so checking the invocation count immediately can race with worker scheduling. ## What changed - Trigger the collector unwind without running the panic hook. Check the collection failure, panic, and busy errors explicitly, and wait for the blocked collector to start before checking invocation and connection counts. - Await the V8 runtime thread panic notifications directly in both tests, removing their one-second receive timeouts. GitOrigin-RevId: 9b2c36577e838c9d327592f9729d3a8a7868c56b
This commit is contained in:
@@ -388,10 +388,7 @@ mod tests {
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
tokio::time::timeout(Duration::from_secs(1), failure_rx.recv())
|
||||
.await
|
||||
.expect("runtime failure timeout")
|
||||
.expect("runtime failure"),
|
||||
failure_rx.recv().await.expect("runtime failure"),
|
||||
"code-mode V8 runtime thread panicked"
|
||||
);
|
||||
}
|
||||
@@ -406,9 +403,7 @@ mod tests {
|
||||
);
|
||||
|
||||
assert!(matches!(
|
||||
tokio::time::timeout(Duration::from_secs(1), event_rx.recv())
|
||||
.await
|
||||
.expect("runtime panic event timeout"),
|
||||
event_rx.recv().await,
|
||||
Some(RuntimeEvent::ThreadPanicked)
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user