From 3dd64e01319f597fbb116687634a1c21c1b1bad1 Mon Sep 17 00:00:00 2001 From: Guillaume Raffin Date: Fri, 5 Jun 2026 14:11:04 +0200 Subject: [PATCH] test(core): fix flaky test control::source_flush The test incorrectly used the output `n_written` metric, but what we want to actually check is just the source flush (i.e. the transform input). The latency of the output is irrelevant, and made the test flaky. --- core/alumet/tests/control.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/alumet/tests/control.rs b/core/alumet/tests/control.rs index c249ea620..ea49424bd 100644 --- a/core/alumet/tests/control.rs +++ b/core/alumet/tests/control.rs @@ -234,7 +234,7 @@ fn source_flush() { // poll often but never flush automatically let trigger = TriggerSpec::builder(Duration::from_millis(100)) - .flush_interval(Duration::from_secs(120)) + .flush_interval(Duration::from_secs(1_000)) .build() .unwrap(); @@ -273,7 +273,6 @@ fn source_flush() { // check that the source has been flushed println!("checking flush"); - let n_written_after_flush = counters.n_written.load(COUNTER_ORD); let n_flushed_after_flush = counters.n_transform_in.load(COUNTER_ORD); assert_ne!(n_flushed_after_flush, 0); @@ -281,9 +280,7 @@ fn source_flush() { println!("waiting more"); std::thread::sleep(Duration::from_millis(500)); println!("checking not flushed"); - let n_written_later = counters.n_written.load(COUNTER_ORD); let n_flushed_later = counters.n_transform_in.load(COUNTER_ORD); - assert!(n_written_later > n_written_after_flush); assert_eq!(n_flushed_later, n_flushed_after_flush); // shutdown