mirror of
https://github.com/openai/codex.git
synced 2026-11-03 19:53:25 +00:00
Wait for turn analytics before shutting down the Guardian v2 test (#42933)
In `guardian_v2_routes_scoped_tool_approvals`, wait for the reviewed thread's `codex_turn_event` before shutting down the app server. Use the returned event for assertions instead of looking it up in the post-shutdown analytics snapshot. GitOrigin-RevId: 3ba4d37838852842c6caf7701d3abf7c89166a98
This commit is contained in:
committed by
copyberry
parent
12fe9f822c
commit
ddf04ad267
@@ -1559,15 +1559,14 @@ async fn guardian_v2_routes_scoped_tool_approvals(
|
||||
})
|
||||
.await?;
|
||||
}
|
||||
let turn = wait_for_matching_analytics_event(&analytics_server, TIMEOUT, |event| {
|
||||
event["event_type"] == "codex_turn_event"
|
||||
&& event["event_params"]["thread_id"] == reviewed_thread_id
|
||||
})
|
||||
.await?;
|
||||
timeout(TIMEOUT, app_server.shutdown_gracefully()).await??;
|
||||
let events = captured_analytics_events(&analytics_server).await;
|
||||
let turn = &events
|
||||
.iter()
|
||||
.find(|event| {
|
||||
event["event_type"] == "codex_turn_event"
|
||||
&& event["event_params"]["thread_id"] == reviewed_thread_id
|
||||
})
|
||||
.expect("parent turn analytics")["event_params"];
|
||||
let turn = &turn["event_params"];
|
||||
assert_eq!(turn["guardian_v2_enabled"], classifier_in_scope);
|
||||
let classification = events.iter().find(|event| {
|
||||
event["event_type"] == "codex_guardian_v2_classification"
|
||||
|
||||
Reference in New Issue
Block a user