From 53a92c5cdaf1bd060aa1c889e2102fcffdbd1d12 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 6 Oct 2025 20:12:19 +0100 Subject: [PATCH] ci: try to reduce flakiness for the lapin integration tests This seems to flake out reasonably regularly in CI on PRs. Let's see if adjusting the ordering of things a little bit encourages a less flakey result. --- crates/integration-tests/src/rabbit.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/integration-tests/src/rabbit.rs b/crates/integration-tests/src/rabbit.rs index 9edd51c8..ab3560fb 100644 --- a/crates/integration-tests/src/rabbit.rs +++ b/crates/integration-tests/src/rabbit.rs @@ -61,9 +61,6 @@ async fn test_lapin_rabbit() -> anyhow::Result<()> { .wait_for_maildir_count(1, Duration::from_secs(10)) .await; - daemon.stop_both().await.context("stop_both")?; - println!("Stopped!"); - let mut consumer = channel .basic_consume( "woot", @@ -76,21 +73,24 @@ async fn test_lapin_rabbit() -> anyhow::Result<()> { let timeout = tokio::time::Duration::from_secs(20); // Wait for Reception record - let delivery = tokio::time::timeout(timeout, consumer.next()) + let reception = tokio::time::timeout(timeout, consumer.next()) .await? .unwrap(); - let delivery = delivery?; - println!("{}", String::from_utf8_lossy(&delivery.data)); - delivery.ack(BasicAckOptions::default()).await?; + let reception = reception?; + println!("reception={}", String::from_utf8_lossy(&reception.data)); + reception.ack(BasicAckOptions::default()).await?; // Wait for Delivery record let delivery = tokio::time::timeout(timeout, consumer.next()) .await? .unwrap(); let delivery = delivery?; - println!("{}", String::from_utf8_lossy(&delivery.data)); + println!("delivery={}", String::from_utf8_lossy(&delivery.data)); delivery.ack(BasicAckOptions::default()).await?; + daemon.stop_both().await.context("stop_both")?; + println!("Stopped!"); + Ok(()) }