From 6917f4231e3fdd771a6b1156631d90a25eff1231 Mon Sep 17 00:00:00 2001 From: James MacMahon Date: Thu, 30 May 2024 04:33:30 +0000 Subject: [PATCH] wait until the task starts --- nexus/tests/integration_tests/disks.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nexus/tests/integration_tests/disks.rs b/nexus/tests/integration_tests/disks.rs index 8794d51a03..94945fa334 100644 --- a/nexus/tests/integration_tests/disks.rs +++ b/nexus/tests/integration_tests/disks.rs @@ -47,6 +47,7 @@ use oximeter::types::Measurement; use sled_agent_client::TestInterfaces as _; use std::collections::HashSet; use std::sync::Arc; +use tokio::sync::oneshot; use uuid::Uuid; type ControlPlaneTestContext = @@ -2495,7 +2496,11 @@ async fn test_no_halt_disk_delete_one_region_on_expunged_agent( let disk_url = get_disk_url(DISK_NAME); let client = client.clone(); + let (task_started_tx, task_started_rx) = oneshot::channel(); + let jh = tokio::spawn(async move { + task_started_tx.send(()).unwrap(); + NexusRequest::object_delete(&client, &disk_url) .authn_as(AuthnMode::PrivilegedUser) .execute() @@ -2503,6 +2508,9 @@ async fn test_no_halt_disk_delete_one_region_on_expunged_agent( .expect("failed to delete disk"); }); + // Wait until the task starts + task_started_rx.await.unwrap(); + // It won't finish until the dataset is expunged. assert!(!jh.is_finished());