Skip to content

Commit cee0298

Browse files
committed
codex: fix CI failure on PR #13657
1 parent f20933d commit cee0298

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

codex-rs/core/src/agent/control.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ mod tests {
914914
sleep(Duration::from_millis(25)).await;
915915
}
916916
};
917-
timeout(Duration::from_secs(2), wait).await.is_ok()
917+
timeout(Duration::from_secs(5), wait).await.is_ok()
918918
}
919919

920920
#[tokio::test]
@@ -1601,6 +1601,26 @@ mod tests {
16011601
.get_thread(child_thread_id)
16021602
.await
16031603
.expect("child thread should exist");
1604+
let mut status_rx = harness
1605+
.control
1606+
.subscribe_status(child_thread_id)
1607+
.await
1608+
.expect("status subscription should succeed");
1609+
if matches!(status_rx.borrow().clone(), AgentStatus::PendingInit) {
1610+
timeout(Duration::from_secs(5), async {
1611+
loop {
1612+
status_rx
1613+
.changed()
1614+
.await
1615+
.expect("child status should advance past pending init");
1616+
if !matches!(status_rx.borrow().clone(), AgentStatus::PendingInit) {
1617+
break;
1618+
}
1619+
}
1620+
})
1621+
.await
1622+
.expect("child should initialize before shutdown");
1623+
}
16041624
let _ = child_thread
16051625
.submit(Op::Shutdown {})
16061626
.await

0 commit comments

Comments
 (0)