[
https://issues.apache.org/jira/browse/CAMEL-24640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112552#comment-18112552
]
Guillaume Nodet commented on CAMEL-24640:
-----------------------------------------
This issue is being investigated by a coding agent (on behalf of gnodet).
Initial triage findings: The test MasterQuartzEndpointIT is flaky due to
insufficient wait time combined with no explicit readiness check before
assertion. The quartz cron fires every 2 seconds and the test expects at least
2 messages, but the chain of ZooKeeper container startup, Curator connection
(3s timeout), master election, and quartz scheduler initialization must all
complete before the first cron fires. The default resultWaitTime falls back to
10 seconds, which is barely enough for the full startup chain plus two cron
fires under CI load. Additionally, the @RegisterExtension ZooKeeper service in
the test class appears unused (the actual ZK instance comes from the Spring XML
context bean), which could cause redundant container overhead.
Proposed fix: add an Awaitility wait for master election (like MasterEndpointIT
does) and increase resultWaitTime, following the pattern established in sibling
tests.
_Note: This comment was generated by an AI coding agent and requires manual
verification._
> Fix flaky test MasterQuartzEndpointIT
> -------------------------------------
>
> Key: CAMEL-24640
> URL: https://issues.apache.org/jira/browse/CAMEL-24640
> Project: Camel
> Issue Type: Test
> Components: camel-zookeeper-master
> Affects Versions: 4.23.0
> Reporter: Aurélien Pupier
> Assignee: Guillaume Nodet
> Priority: Minor
>
> it has failed 4 times in the last 90 days and "only" flaky 10 times
> {noformat}
> java.lang.AssertionError: mock://results Received message count 0, expected
> at least 2
> at
> org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:2075)
> at
> org.apache.camel.component.mock.MockEndpoint.assertTrue(MockEndpoint.java:2046)
>
> at
> org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:510)
>
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:476)
>
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:466)
>
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:265)
>
> at
> org.apache.camel.component.zookeepermaster.MasterQuartzEndpointIT.testEndpoint(MasterQuartzEndpointIT.java:46)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)