This is an automated email from the ASF dual-hosted git repository.
apupier 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 939d2e290eae CAMEL-25623: fix flaky SmbComponentConnectionReadIT
939d2e290eae is described below
commit 939d2e290eae0a4131baee6d19968520b88b5ee2
Author: Aurélien Pupier <[email protected]>
AuthorDate: Tue Oct 13 15:56:11 2026 +0200
CAMEL-25623: fix flaky SmbComponentConnectionReadIT
Two independent causes combined to make the count exceed 100:
1. The consumer had no file filter, so .doc files uploaded by
SmbComponentConnectionIT (file_send.doc, file_ignore.doc,
file_override.doc) were also consumed when that class ran first.
2. Without idempotent=true the SMB default strategy leaves files in
place and the next poll (500 ms later) sends the same 100 files
again. assertIsSatisfied() fires as soon as 100 messages arrive, so
4 messages from the second poll (matching concurrentConsumers=4 on
seda:intermediate) were already in flight when the count was checked.
Fix: add include=^[0-9][0-9]*[.]txt$ to restrict the consumer to the
100 numeric .txt files seeded by the container (1.txt ... 100.txt), and
add idempotent=true so each file is counted at most once per test run.
The include regex avoids the + quantifier because + is a reserved URI
character that Camel's endpoint URI parser would otherwise misinterpret.
Co-authored-by: IBM Bob 2.2.1
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../org/apache/camel/component/smb/SmbComponentConnectionReadIT.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentConnectionReadIT.java
b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentConnectionReadIT.java
index e34a0d5350ed..de3cb4e7ebfa 100644
---
a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentConnectionReadIT.java
+++
b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentConnectionReadIT.java
@@ -70,7 +70,8 @@ class SmbComponentConnectionReadIT extends CamelTestSupport {
.build();
context.getRegistry().bind("smbConfig", config);
- fromF("smb:%s/%s?username=%s&password=%s&smbConfig=#smbConfig",
+ // only consume the 100 files seeded by the container (1.txt
... 100.txt), ignoring files left by other tests
+
fromF("smb:%s/%s?username=%s&password=%s&smbConfig=#smbConfig&include=^[0-9][0-9]*[.]txt$&idempotent=true",
service.address(), service.shareName(),
service.userName(), service.password())
.to("seda:intermediate");