Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

Tests: fix the two flaky tests at their cause

Lin (kwant bot)2d1ab23d71e8
diff --git a/tests/documents_test.rs b/tests/documents_test.rs
index 811bc629..9e4ec475 100644
--- a/tests/documents_test.rs
+++ b/tests/documents_test.rs
@@ -498,7 +498,7 @@ async fn a_text_pdf_and_a_photo_are_read_in_one_model_call() {
// Nothing the letter says was logged
let logged = logs.text();
assert!(logged.contains("documents: reading a letter"), "the capture works");
- for words in ["NW-448812", "Northfield", "142.60", "overdue", "Reply slip", "northfield-water", "City Council"] {
+ for words in ["NW-448812", "Northfield", "GBP 142.60", "overdue", "Reply slip", "northfield-water", "City Council"] {
assert!(!logged.contains(words), "'{words}' reached the logs");
}
}
diff --git a/tests/quota_retry_test.rs b/tests/quota_retry_test.rs
index 4fdcd9be..1cd01e1d 100644
--- a/tests/quota_retry_test.rs
+++ b/tests/quota_retry_test.rs
@@ -129,8 +129,9 @@ async fn a_limited_delegation_stays_open_and_its_retry_finishes_it() {
past_reset(&env).await;
assert_eq!(parked::run_due(&env.state, later()).await, 1);
- wait_for("the retried delegation to complete", || async { status(&env, id.clone()).await == "completed" }).await;
+ // The delegation is marked completed before its result is posted, so wait for the result
+ wait_reply(&env, &env.a, "answer qddone").await;
+ assert_eq!(status(&env, id.clone()).await, "completed");
let lead = messages(&env, &env.a).await;
assert!(lead.iter().any(|m| m.text.contains("retrying “Limited task” once")));
- assert!(lead.iter().any(|m| m.text.contains("answer qddone")));
}