Skip to content

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

test(saas_isolation): tighten storm and generator assertions

Steven Enamakel42a85f91951c
diff --git a/tests/saas_isolation/generators.rs b/tests/saas_isolation/generators.rs
index 9da1e70be8..9b17d116d1 100644
--- a/tests/saas_isolation/generators.rs
+++ b/tests/saas_isolation/generators.rs
@@ -231,6 +231,12 @@ pub fn assert_covers_user_surface() {
let ours: Vec<&str> = GENERATORS.iter().map(|(m, _)| *m).collect();
let missing: Vec<&&str> = USER_METHODS.iter().filter(|m| !ours.contains(m)).collect();
let stale: Vec<&&str> = ours.iter().filter(|m| !USER_METHODS.contains(m)).collect();
+ let mut seen = std::collections::HashSet::new();
+ let duplicate: Vec<&&str> = ours.iter().filter(|m| !seen.insert(**m)).collect();
+ assert!(
+ duplicate.is_empty(),
+ "duplicate isolation-fuzz generators: {duplicate:?}"
+ );
assert!(
missing.is_empty(),
"USER_METHODS entries with no isolation-fuzz generator (add one to \
diff --git a/tests/saas_isolation/storm.rs b/tests/saas_isolation/storm.rs
index 34aeffe751..ee51fee2c6 100644
--- a/tests/saas_isolation/storm.rs
+++ b/tests/saas_isolation/storm.rs
@@ -78,8 +78,7 @@ fn an_eviction_storm_keeps_live_turns_controllable() {
assert!(body.get("result").is_some(), "{body}");
let queued = queue(&node, alice, "live");
assert!(
- queued.to_string().contains("CANARY-alice-followup")
- || queued.to_string().contains("\"id\""),
+ queued.to_string().contains("CANARY-alice-followup"),
"the follow-up is queued: {queued}"
);
@@ -127,6 +126,12 @@ fn an_eviction_storm_keeps_live_turns_controllable() {
"client_id": "c1", "thread_id": thread, "message": canary(i + 1, "storm")
}),
);
+ // Give the turn a moment to start (it may also have finished
+ // already) so the wait below cannot pass before it began.
+ let start = Instant::now();
+ while start.elapsed() < Duration::from_secs(3) && !active(&node, user, &thread) {
+ std::thread::sleep(Duration::from_millis(50));
+ }
wait_until(
"a churning user's short turn",
&node,