Files
codex-proxy-rs/backend/tests/runtime/tasks/coordinator.rs
T
ZyyandCodex 112bd76f66 refactor: address audit findings
Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Zyy <No Email>
2026-07-03 18:20:05 +08:00

32 lines
929 B
Rust

use std::{sync::Arc, time::Duration};
use codex_proxy_rs::{
runtime::tasks::coordinator::SchedulerHandle,
upstream::transport::{CodexWebSocketPool, CodexWebSocketPoolConfig},
};
#[tokio::test]
async fn task_coordinator_should_shutdown_without_panicking() {
let coordinator = codex_proxy_rs::runtime::tasks::coordinator::TaskCoordinator::default();
coordinator.shutdown().await;
}
#[tokio::test]
async fn scheduler_handle_should_shutdown_websocket_pool() {
let pool = Arc::new(CodexWebSocketPool::with_config(CodexWebSocketPoolConfig {
maintenance_interval: None,
ping_interval: None,
liveness_timeout: None,
max_age: Duration::from_secs(60),
max_per_account: 1,
enabled: true,
ping_timeout: Duration::ZERO,
}));
SchedulerHandle::from_websocket_pool(pool.clone())
.shutdown()
.await;
assert!(pool.is_shutdown().await);
}