This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new e4188d0b1e12 CAMEL-27868: camel-dataset: improve DataSetMinRateTest
robustness on loaded CI (#31178)
e4188d0b1e12 is described below
commit e4188d0b1e126dae6598b5540c502671303e6f3c
Author: Guillaume Nodet <[email protected]>
AuthorDate: Tue Dec 1 17:30:01 2026 +0100
CAMEL-27868: camel-dataset: improve DataSetMinRateTest robustness on loaded
CI (#31178)
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
---
.../apache/camel/component/dataset/DataSetMinRateTest.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git
a/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetMinRateTest.java
b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetMinRateTest.java
index cc057dbf96d0..1d8f6f9c7409 100644
---
a/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetMinRateTest.java
+++
b/core/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetMinRateTest.java
@@ -36,7 +36,10 @@ class DataSetMinRateTest extends ContextTestSupport {
// 200 messages at 10 ms each take ~2 s to deliver; resultWaitTime=100 ms
ensures
// the initial latch wait expires before all messages have arrived, so the
minRate
- // loop is actually exercised.
+ // loop is actually exercised. minRate=1 is sufficient to trigger the
original
+ // infinite-spin bug (the alternating delta stays >= 1) while giving CI a
generous
+ // margin on loaded machines (minRate=10 could exit the loop early if a GC
pause
+ // drops a 1s window below 10 messages, causing a spurious count assertion
failure).
private final SimpleDataSet dataSet = new SimpleDataSet(200);
@Override
@@ -64,11 +67,12 @@ class DataSetMinRateTest extends ContextTestSupport {
public void configure() {
// produceDelay=10 ms per message; resultWaitTime=100 ms
expires before all
// 200 messages arrive, so the minRate loop runs at least once.
- // minRate=10 keeps it waiting while messages are still
flowing.
-
from("dataset:foo?initialDelay=0&produceDelay=10&resultWaitTime=100&minRate=10")
+ // minRate=1 is enough to reproduce the original spin
(alternating delta >= 1)
+ // and avoids spurious failures on loaded CI machines with GC
pauses.
+
from("dataset:foo?initialDelay=0&produceDelay=10&resultWaitTime=100&minRate=1")
.to("direct:foo");
from("direct:foo")
-
.to("dataset:foo?initialDelay=0&produceDelay=10&resultWaitTime=100&minRate=10");
+
.to("dataset:foo?initialDelay=0&produceDelay=10&resultWaitTime=100&minRate=1");
}
};
}