Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(saas_mode): add fencing to delivery recovery storage

Steven Enamakel12a5419ebb5a
diff --git a/tests/saas_mode/delivery_recovery.rs b/tests/saas_mode/delivery_recovery.rs
index f1c20fe794..d792f35421 100644
--- a/tests/saas_mode/delivery_recovery.rs
+++ b/tests/saas_mode/delivery_recovery.rs
@@ -110,7 +110,16 @@ fn leave_undelivered_result(root: &std::path::Path, user: &str) {
CompletionResult::text(RESULT),
)
.with_notify_mode(NotifyMode::Followup);
- store.put(&record).expect("write the pending record");
+ let gate = store
+ .acquire_parent_gate(THREAD, "delivery-recovery-fixture", std::time::Duration::from_secs(30))
+ .expect("acquire the parent's completion gate")
+ .expect("the completion gate is free");
+ store
+ .put_fenced(&record, THREAD, &gate)
+ .expect("write the pending record under the parent gate");
+ assert!(store
+ .release_parent_gate(THREAD, &gate)
+ .expect("release the fixture's parent gate"));
}
#[test]