test(server): join prepared restore owners with operation-bound Stop

This commit is contained in:
2026-11-05 01:58:24 +09:00
parent 50c5c80527
commit e6db25497d
@@ -2035,11 +2035,22 @@ async fn restore_after_real_prepare_rejects_revoked_host_trust_without_publicati
); );
// Only this fixture's retained operation is cleaned up, after its durable // Only this fixture's retained operation is cleaned up, after its durable
// evidence has been checked. Cleanup is not the restore outcome above. // evidence has been checked. Cleanup is not the restore outcome above.
let cleanup = execution.stop_worker(&worker_ref); let stop = worker_runtime::execution::WorkerExecutionStopRequest {
worker_ref: worker_ref.clone(),
operation_id: worker_runtime::execution::WorkerLifecycleOperationId::new(),
};
let cleanup = execution.stop_worker_operation(stop.clone());
assert!( assert!(
cleanup.is_accepted(), cleanup.is_accepted(),
"fixture restore cleanup: {cleanup:?}" "fixture restore cleanup: {cleanup:?}"
); );
assert!(
cleanup
.termination
.as_ref()
.is_some_and(|receipt| receipt.confirms_scope_shutdown(&worker_ref, stop.operation_id)),
"fixture cleanup must join its original prepared owner: {cleanup:?}"
);
shutdown_workspace_feature_storage(&api).await.unwrap(); shutdown_workspace_feature_storage(&api).await.unwrap();
} }
@@ -2534,9 +2545,17 @@ async fn connected_explicit_repair(scenario: ConnectedRepair) {
let worker_ref = worker_runtime::identity::WorkerRef::try_from(worker).unwrap(); let worker_ref = worker_runtime::identity::WorkerRef::try_from(worker).unwrap();
if revoked { if revoked {
assert!(fixture.execution.worker_snapshot(&worker_ref).is_none()); assert!(fixture.execution.worker_snapshot(&worker_ref).is_none());
let stop = worker_runtime::execution::WorkerExecutionStopRequest {
worker_ref: worker_ref.clone(),
operation_id: worker_runtime::execution::WorkerLifecycleOperationId::new(),
};
let cleanup = fixture.execution.stop_worker_operation(stop.clone());
assert!(cleanup.is_accepted(), "fixture repair cleanup: {cleanup:?}");
assert!( assert!(
fixture.execution.stop_worker(&worker_ref).is_accepted(), cleanup.termination.as_ref().is_some_and(
"fixture-owned repair resource cleanup" |receipt| receipt.confirms_scope_shutdown(&worker_ref, stop.operation_id)
),
"fixture cleanup must join its original repair owner: {cleanup:?}"
); );
} else { } else {
assert!(fixture.execution.worker_snapshot(&worker_ref).is_some()); assert!(fixture.execution.worker_snapshot(&worker_ref).is_some());