From c496a5bfdf6916561e2bb89088cdc839d1d462a5 Mon Sep 17 00:00:00 2001 From: Derek Carr Date: Tue, 28 Jul 2026 11:40:54 -0400 Subject: [PATCH] fix(server): stabilize flaky delete telemetry unit test Replace yield_now() spin-loop with sleep(10ms) polling in delete_handler_ends_telemetry_for_the_resolved_sandbox_id. The single-threaded tokio runtime starves the spawn_blocking threads used by SQLite when yield_now() burns 100% CPU waiting for the delete gate entry count. Increase the timeout from 1s to 5s for consistency with similar guard tests. Signed-off-by: Derek Carr --- crates/openshell-server/src/grpc/sandbox.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/openshell-server/src/grpc/sandbox.rs b/crates/openshell-server/src/grpc/sandbox.rs index 57bf421b88..c87fc01436 100644 --- a/crates/openshell-server/src/grpc/sandbox.rs +++ b/crates/openshell-server/src/grpc/sandbox.rs @@ -2477,9 +2477,9 @@ mod tests { ) .await }); - tokio::time::timeout(std::time::Duration::from_secs(1), async { + tokio::time::timeout(std::time::Duration::from_secs(5), async { while state.compute.delete_gate_entry_count() == 0 { - tokio::task::yield_now().await; + tokio::time::sleep(std::time::Duration::from_millis(10)).await; } }) .await