You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/07/10 14:21:49 UTC

[PR] Fix flaky HazelcastReplicatedmapConsumerTest (18% failure rate) [camel]

gnodet opened a new pull request, #24590:
URL: https://github.com/apache/camel/pull/24590

   ## Summary
   
   _Claude Code on behalf of gnodet_
   
   Fixes the persistent flakiness of `HazelcastReplicatedmapConsumerTest` (18% failure rate on Develocity — 35/194 runs failing). The prior fix ([CAMEL-22506](https://issues.apache.org/jira/browse/CAMEL-22506)) added `map.clear()` + mock reset in `@BeforeEach`, but that approach itself introduces the flakiness because `clear()` fires async REMOVED events through the still-active Hazelcast entry listener.
   
   **Root cause:** `map.clear()` in `@BeforeEach` fires async REMOVED events that bleed between tests because the Hazelcast `EntryListener` is still registered. Additionally, `testRemove()` calls `map.remove()` immediately after `map.put()` without waiting for the ADDED event to be processed, creating a race condition.
   
   **Fix:**
   - **`@BeforeEach`**: Stop routes before clearing the map to deregister the entry listener (via `HazelcastReplicatedmapConsumer.doStop()`), preventing stale REMOVED events from reaching mock endpoints. Restart routes after clearing and resetting mocks.
   - **`testRemove()`**: Wait for the ADDED event to be delivered before calling `remove()`, eliminating the put/remove race.
   - **`testEvict()`**: Replace redundant Awaitility-wrapped `MockEndpoint.assertIsSatisfied()` with the native latch-based timed assertion (per project conventions — Awaitility polls on top of an already-waiting mechanism).
   
   ## Test plan
   
   - [x] All 3 tests pass locally
   - [x] Validated with **100 consecutive runs — 0 failures** (vs. ~18 expected failures without fix)
   - [x] Code formatted with `mvn formatter:format impsort:sort`
   - [ ] CI build passes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix flaky HazelcastReplicatedmapConsumerTest (18% failure rate) [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #24590:
URL: https://github.com/apache/camel/pull/24590


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix flaky HazelcastReplicatedmapConsumerTest (18% failure rate) [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24590:
URL: https://github.com/apache/camel/pull/24590#issuecomment-4936663873

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-hazelcast`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 9 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **1 affected modules** (current approach: 9).
   
   <details><summary>Modules only in current approach (8)</summary>
   
   - `camel-jbang-mcp`
   - `camel-jbang-plugin-mcp`
   - `camel-jbang-plugin-route-parser`
   - `camel-jbang-plugin-tui`
   - `camel-jbang-plugin-validate`
   - `camel-launcher-container`
   - `camel-yaml-dsl-validator`
   - `camel-yaml-dsl-validator-maven-plugin`
   
   </details>
   
   **Skip-tests mode would test 1 modules** (1 direct + 0 downstream), **skip tests for 0** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (1)</summary>
   
   - `camel-hazelcast`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (9 modules)</summary>
   
   - Camel :: HazelCast
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: TUI
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Launcher :: Container
   - Camel :: YAML DSL :: Validator
   - Camel :: YAML DSL :: Validator Maven Plugin
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/29100025144)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix flaky HazelcastReplicatedmapConsumerTest (18% failure rate) [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24590:
URL: https://github.com/apache/camel/pull/24590#issuecomment-4936340265

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org