Wait for busy guest readiness before measuring shutdown grace
ci / check (push) Failing after 11m45s
ci / check (push) Failing after 11m45s
This commit is contained in:
@@ -1015,6 +1015,7 @@ async fn stop_deadlines() {
|
||||
async fn shutdown_stops_busy_processes_in_parallel_after_five_seconds() {
|
||||
let w = TestWorld::new();
|
||||
let h = w.start().await;
|
||||
let mut notifications = h.subscribe();
|
||||
|
||||
let mut tasks = Vec::new();
|
||||
for _ in 0..2 {
|
||||
@@ -1024,14 +1025,14 @@ async fn shutdown_stops_busy_processes_in_parallel_after_five_seconds() {
|
||||
}));
|
||||
}
|
||||
tokio::time::timeout(std::time::Duration::from_secs(20), async {
|
||||
while h
|
||||
.processes()
|
||||
.values()
|
||||
.filter(|p| p.plugin == "probe" && p.method == "busy")
|
||||
.count()
|
||||
!= 2
|
||||
{
|
||||
tokio::task::yield_now().await;
|
||||
// Admission precedes guest startup. Stopping at admission can close
|
||||
// stdin before the guest receives its busy request, so there is then
|
||||
// no busy work that needs the five-second kill budget.
|
||||
let mut ready = 0;
|
||||
while ready != tasks.len() {
|
||||
if notifications.recv().await.unwrap()["params"]["name"] == "busy-ready" {
|
||||
ready += 1;
|
||||
}
|
||||
}
|
||||
})
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user