Skip to content

MINOR: mark flaky test#21836

Open
lianetm wants to merge 1 commit intoapache:trunkfrom
lianetm:lm-mark-flaky
Open

MINOR: mark flaky test#21836
lianetm wants to merge 1 commit intoapache:trunkfrom
lianetm:lm-mark-flaky

Conversation

@lianetm
Copy link
Member

@lianetm lianetm commented Mar 20, 2026

Pretty flaky on trunk lately, showing up on unrelated open PRs Tracked
to fix with https://issues.apache.org/jira/browse/KAFKA-20345

@github-actions github-actions bot added build Gradle build or GitHub Actions group-coordinator small Small PRs labels Mar 20, 2026
@lianetm
Copy link
Member Author

lianetm commented Mar 20, 2026

cc. @squah-confluent just for awareness (or in case you may have thoughts to share on the jira on how to fix). Thanks!

@chia7712
Copy link
Member

The root cause is that the completion of the Runnable does not mean recordBackgroundProcessingTime has finished. We should add verify(metrics, timeout(5000)).recordBackgroundProcessingTime to ensure the metric is actually recorded

            // Task 1 takes 100 ms.
            mockTime.sleep(100);
            task1Unblocked.countDown();
            task1.get(5, TimeUnit.SECONDS);
            verify(metrics, timeout(5000)).recordBackgroundProcessingTime(100);

            // Task 3 starts.
            task3Started.await();

            // Task 2 takes 500 ms.
            mockTime.sleep(400);
            task2Unblocked.countDown();
            task2.get(5, TimeUnit.SECONDS);
            verify(metrics, timeout(5000)).recordBackgroundProcessingTime(500);

            // Task 3 takes 500 ms.
            mockTime.sleep(100);
            task3Unblocked.countDown();
            task3.get(5, TimeUnit.SECONDS);
            verify(metrics, timeout(5000).times(2)).recordBackgroundProcessingTime(500);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions group-coordinator small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants