Skip to content

Commit c496a5b

Browse files
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 <[email protected]>
1 parent f00ad23 commit c496a5b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎crates/openshell-server/src/grpc/sandbox.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,9 +2477,9 @@ mod tests {
24772477
)
24782478
.await
24792479
});
2480-
tokio::time::timeout(std::time::Duration::from_secs(1), async {
2480+
tokio::time::timeout(std::time::Duration::from_secs(5), async {
24812481
while state.compute.delete_gate_entry_count() == 0 {
2482-
tokio::task::yield_now().await;
2482+
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
24832483
}
24842484
})
24852485
.await

0 commit comments

Comments
 (0)