[
https://issues.apache.org/jira/browse/FLINK-40136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated FLINK-40136:
-----------------------------------
Labels: pull-request-available (was: )
> DynamicKafkaSourceEnumeratorTest flaky due to ConcurrentModificationException
> in metadata event polling
> -------------------------------------------------------------------------------------------------------
>
> Key: FLINK-40136
> URL: https://issues.apache.org/jira/browse/FLINK-40136
> Project: Flink
> Issue Type: Bug
> Reporter: Sylwester Lachiewicz
> Priority: Minor
> Labels: pull-request-available
>
> ▎ hasLatestMetadataUpdateEvent() polls
> getLatestMetadataUpdateEventWithoutContextSync(), which reads
> MockSplitEnumeratorContext's internal sentSourceEvent list via reflection
> directly from the JUnit test thread, bypassing the context's single-threaded
> main executor. The enumerator's metadata discovery thread appends to that
> same list via sendEventToSourceReader() (correctly serialized through the
> main executor), so a test thread iterating the list via Stream.reduce() while
> that thread appends to it occasionally throws ConcurrentModificationException
> instead of the intended AssertionError "not ready yet" signal, causing
> intermittent test failures.
> ▎ Fix: catch ConcurrentModificationException alongside AssertionError in the
> CommonTestUtils.waitUtil(...) polling loop so it retries instead of failing
> the test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)