mirror of
https://github.com/rustfs/rustfs.git
synced 2026-10-28 15:02:49 +00:00
test(ecstore): pin native history on cancellation under the cancellable queue
main moved the local write path onto the disk blocking queue, which skips an operation once its waiter is dropped, so a borrowed write cancelled while it is queued no longer creates its file. The integration-only native publication test still expected the queued open to run. Assert the new execution model instead (the open never runs) while keeping its safety claims: the Started record is taken before queueing and the cancelled publication never regrants native history.
This commit is contained in:
@@ -13702,11 +13702,14 @@ mod test {
|
||||
started_before_execution,
|
||||
"the borrowed write must consume native history before queueing its open"
|
||||
);
|
||||
assert!(path.is_file(), "cancelling the borrowed waiter must leave the queued open running");
|
||||
std::fs::remove_file(&path).expect("remove the file published by the cancelled waiter");
|
||||
// The disk blocking queue skips an operation once its waiter is gone
|
||||
// (`run_cancellable` observes the closed result channel), so the open
|
||||
// never runs. The Started record taken before queueing must survive
|
||||
// that cancellation: the proof stays conservatively consumed.
|
||||
assert!(!path.exists(), "a cancelled borrowed write must not run its queued open");
|
||||
assert!(
|
||||
history.witness(&bucket, disk_id, Arc::clone(&disk.io_backend)).is_none(),
|
||||
"executor drain and physical removal must not regrant native history"
|
||||
"executor drain must not regrant native history to a cancelled publication"
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user