Skip to content

Commit

Permalink
wait until the task starts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmpesp committed May 30, 2024
1 parent 0baa9c8 commit 6917f42
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nexus/tests/integration_tests/disks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -2495,14 +2496,21 @@ 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()
.await
.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());

Expand Down

0 comments on commit 6917f42

Please sign in to comment.