diff --git a/rustfs/src/connect/diagnostics/trace_runtime.rs b/rustfs/src/connect/diagnostics/trace_runtime.rs index d32ac66db..04aa165ff 100644 --- a/rustfs/src/connect/diagnostics/trace_runtime.rs +++ b/rustfs/src/connect/diagnostics/trace_runtime.rs @@ -2426,11 +2426,15 @@ mod tests { rustfs_credentials::set_global_rpc_secret("top-rpc-local-test-secret".to_owned()).unwrap(); let runtime = spawn_local_trace_capture_runtime(std::path::Path::new(&state), &stop).unwrap(); let emit = async { - // Executable hashing precedes subscription. The parent's bounded - // request and stdin cancellation govern this readiness wait. - while telemetry_trace_subscriber_count() == 0 { - tokio::task::yield_now().await; - } + // Hashing the CI test executable must finish before timing subscriber readiness. + super::super::job_delivery::executable_provenance().await.unwrap(); + tokio::time::timeout(Duration::from_secs(10), async { + while telemetry_trace_subscriber_count() == 0 { + tokio::task::yield_now().await; + } + }) + .await + .expect("top.rpc service subscriber"); let listener = TcpListener::bind("127.0.0.1:0").await.unwrap(); let addr = listener.local_addr().unwrap(); let server = tokio::spawn(async move { @@ -2569,11 +2573,15 @@ mod tests { tokio::runtime::Runtime::new().unwrap().block_on(async { let runtime = spawn_local_trace_capture_runtime(std::path::Path::new(&state), &stop).unwrap(); let emit = async { - // Executable hashing precedes subscription. The parent's bounded - // request and stdin cancellation govern this readiness wait. - while telemetry_trace_subscriber_count() == 0 { - tokio::task::yield_now().await; - } + // Hashing the CI test executable must finish before timing subscriber readiness. + super::super::job_delivery::executable_provenance().await.unwrap(); + tokio::time::timeout(Duration::from_secs(10), async { + while telemetry_trace_subscriber_count() == 0 { + tokio::task::yield_now().await; + } + }) + .await + .expect("top.api service subscriber"); for (operation, status) in [ (S3Operation::GetObject, 200), (S3Operation::GetObject, 503),