Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

test(redact): wait for worker completion

Louis Beaumont26145eae7931
diff --git a/crates/screenpipe-redact/tests/worker_integration.rs b/crates/screenpipe-redact/tests/worker_integration.rs
index ce4452a93..3e71eebb6 100644
--- a/crates/screenpipe-redact/tests/worker_integration.rs
+++ b/crates/screenpipe-redact/tests/worker_integration.rs
@@ -371,7 +371,16 @@ async fn worker_skips_already_redacted_rows() {
let worker = Worker::new(pool.clone(), redactor, cfg);
let handle = worker.clone().spawn();
- tokio::time::sleep(Duration::from_millis(120)).await;
+ wait_until("unredacted frame watermark", || async {
+ sqlx::query_scalar::<_, i64>(
+ "SELECT COUNT(*) FROM frames WHERE id = 2 AND full_text_redacted_at IS NOT NULL",
+ )
+ .fetch_one(&pool)
+ .await
+ .unwrap()
+ == 1
+ })
+ .await;
handle.abort();
let status = worker.status().await;