From 2fdcdc120a3f717de465c2e7afbb7f5168df6f85 Mon Sep 17 00:00:00 2001 From: Leynos Date: Mon, 4 Aug 2025 20:45:43 +0100 Subject: [PATCH 1/2] Throttle worker retries in tests --- crates/comenqd/src/daemon.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/comenqd/src/daemon.rs b/crates/comenqd/src/daemon.rs index 4df9ac4..a3e28d7 100644 --- a/crates/comenqd/src/daemon.rs +++ b/crates/comenqd/src/daemon.rs @@ -334,7 +334,8 @@ mod tests { async fn setup_run_worker(status: u16) -> (MockServer, Arc, Receiver, Arc) { let dir = tempdir().expect("tempdir"); let cfg = Arc::new(Config { - cooldown_period_seconds: 0, + // Use a positive cooldown to ensure retries are throttled. + cooldown_period_seconds: 1, ..temp_config(&dir) }); let (mut sender, rx) = channel(&cfg.queue_path).expect("channel"); @@ -352,7 +353,12 @@ mod tests { let server = MockServer::start().await; Mock::given(method("POST")) .and(path("/repos/o/r/issues/1/comments")) - .respond_with(ResponseTemplate::new(status).set_body_raw("{}", "application/json")) + .respond_with( + ResponseTemplate::new(status).set_body_json(&serde_json::json!({ + "id": 1, + "body": "b", + })), + ) .mount(&server) .await; From 2792c5ff4f6c80cd490565328aa4e470754e1499 Mon Sep 17 00:00:00 2001 From: Payton McIntosh Date: Mon, 4 Aug 2025 20:55:02 +0100 Subject: [PATCH 2/2] Add simple test to ci --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e95a34..967f255 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: run: make check-fmt - name: Lint run: make lint + - name: Test Only + run: make test - name: Test and Measure Coverage uses: leynos/shared-actions/.github/actions/generate-coverage@c6559452842af6a83b83429129dccaf910e34562 with: