Skip to content

Commit

Permalink
test(ha/shutdown): busy wait for republish
Browse files Browse the repository at this point in the history
Fixes flaky test introduced on shutdown fix.

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Feb 10, 2025
1 parent 081f005 commit e2cc34b
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions control-plane/agents/src/bin/core/tests/volume/switchover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,18 +773,27 @@ async fn reshutdown(cluster: &Cluster) {
.await
.expect("Volume Destroy should succeed.");

let _volume = client
.republish(
&RepublishVolume {
uuid: VOLUME_UUID.try_into().unwrap(),
share: VolumeShareProtocol::Nvmf,
target_node: None,
reuse_existing: true,
frontend_node: cluster.node(1),
reuse_existing_fallback: true,
},
None,
)
.await
.expect("Volume republish should have succeeded.");
let start = std::time::Instant::now();
let mut result = Ok(());
while start.elapsed() < std::time::Duration::from_secs(3) {
result = client
.republish(
&RepublishVolume {
uuid: VOLUME_UUID.try_into().unwrap(),
share: VolumeShareProtocol::Nvmf,
target_node: None,
reuse_existing: true,
frontend_node: cluster.node(1),
reuse_existing_fallback: true,
},
None,
)
.await
.map(|_| ());
if result.is_ok() {
break;
}
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
}
assert!(result.is_ok(), "Volume republish should have succeeded");
}

0 comments on commit e2cc34b

Please sign in to comment.