mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 04:40:39 +00:00
fix: operating region guards should be dropped when procedure is done (#3775)
This commit is contained in:
@@ -121,3 +121,22 @@ pub fn new_test_procedure_context() -> Context {
|
||||
provider: Arc::new(MockContextProvider::default()),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn execute_procedure_until<P: Procedure>(procedure: &mut P, until: impl Fn(&P) -> bool) {
|
||||
let mut reached = false;
|
||||
let context = new_test_procedure_context();
|
||||
while !matches!(
|
||||
procedure.execute(&context).await.unwrap(),
|
||||
Status::Done { .. }
|
||||
) {
|
||||
if until(procedure) {
|
||||
reached = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert!(
|
||||
reached,
|
||||
"procedure '{}' did not reach the expected state",
|
||||
procedure.type_name()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user