Skip to content

Commit a7ae400

Browse files
committed
Auto-drain evictions on shutdown
1 parent f420ded commit a7ae400

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

core/src/test_help/mod.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,10 +1068,19 @@ impl WorkerExt for Worker {
10681068
);
10691069
},
10701070
async {
1071-
assert_matches!(
1072-
self.poll_workflow_activation().await.unwrap_err(),
1073-
PollError::ShutDown
1074-
);
1071+
loop {
1072+
match self.poll_workflow_activation().await {
1073+
Err(PollError::ShutDown) => break,
1074+
Ok(a) if a.is_only_eviction() => {
1075+
self.complete_workflow_activation(WorkflowActivationCompletion::empty(
1076+
a.run_id,
1077+
))
1078+
.await
1079+
.unwrap();
1080+
}
1081+
o => panic!("Unexpected activation while draining: {:?}", o),
1082+
}
1083+
}
10751084
}
10761085
);
10771086
self.finalize_shutdown().await;

0 commit comments

Comments
 (0)