v0.3.6-pre.009-fix.001
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-job-backfill-lib/unit_tests/execution.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum FakeDisposition {
|
||||
@@ -291,9 +291,9 @@ async fn pre_009_cancellation_stops_admission_and_drains_already_admitted_candid
|
||||
FakePlan { pending_polls: 0, disposition: FakeDisposition::Durable },
|
||||
FakePlan { pending_polls: 0, disposition: FakeDisposition::Durable },
|
||||
]);
|
||||
let token = ksp_job_api::JobCancellationToken::new();
|
||||
let (cancel_sender, cancel_receiver) = tokio::sync::watch::channel(false);
|
||||
let control = crate::runtime::BackfillRuntimeControl::new(cancel_sender);
|
||||
let signal = crate::runtime::BackfillCancellationSignal::new(control.token(), cancel_receiver);
|
||||
let signal = crate::BackfillCancellationSignal::new(token.clone(), cancel_receiver);
|
||||
let execution = super::execute_with_processor(&processor, &request, &discovery, std::option::Option::Some(&signal), std::option::Option::None);
|
||||
let cancellation = async {
|
||||
loop {
|
||||
@@ -302,7 +302,8 @@ async fn pre_009_cancellation_stops_admission_and_drains_already_admitted_candid
|
||||
}
|
||||
tokio::task::yield_now().await;
|
||||
}
|
||||
assert!(control.request_cancellation());
|
||||
assert!(token.cancel());
|
||||
assert!(cancel_sender.send(true).is_ok());
|
||||
};
|
||||
let (result, ()) = tokio::join!(execution, cancellation);
|
||||
let batch = match result {
|
||||
|
||||
Reference in New Issue
Block a user