You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2026/07/12 01:14:00 UTC
[jira] [Assigned] (CAMEL-24006) Fix flaky JpaPollingConsumerLockEntityTest
[ https://issues.apache.org/jira/browse/CAMEL-24006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guillaume Nodet reassigned CAMEL-24006:
---------------------------------------
Assignee: Guillaume Nodet
> Fix flaky JpaPollingConsumerLockEntityTest
> ------------------------------------------
>
> Key: CAMEL-24006
> URL: https://issues.apache.org/jira/browse/CAMEL-24006
> Project: Camel
> Issue Type: Bug
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Priority: Major
> Labels: flaky-test
>
> The JpaPollingConsumerLockEntityTest is flaky on CI. Develocity data over the last 10 days shows:
> - testPollingConsumerWithoutLock: 9 failures + 7 flaky out of 270 runs (5.9%)
> - testPollingConsumerWithLock: 0 failures + 15 flaky out of 270 runs (5.6%)
> The testPollingConsumerWithoutLock test relies on two concurrent JPA polling consumers racing to update the same versioned entity, expecting an OptimisticLockException. However, the race condition is not deterministic — sometimes one request completes before the other starts reading, so no conflict occurs.
> The fix uses a CyclicBarrier in the enrichment strategy to synchronize both threads after the read step, ensuring they both hold stale entity versions before either proceeds to write. This makes the conflict deterministic.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)