Fix flaky ReaderSeekTest: avoid topic name collision between test instances - #613
Open
merlimat wants to merge 1 commit into
Open
Fix flaky ReaderSeekTest: avoid topic name collision between test instances#613merlimat wants to merge 1 commit into
merlimat wants to merge 1 commit into
Conversation
…tances testSeekToEndByTimestamp and testHasMessageAvailableAfterSeekToEnd name their topic with only a second-granularity timestamp, but gtest-parallel runs the /0 and /1 parameter instances as separate concurrent processes. When both start within the same second they share the same topic, and one instance's publish can land after the other's seek-to-end but before its hasMessageAvailable() check, which then correctly returns true and fails the assertion. Retries keep colliding the same way, so the whole job fails. Append GetParam() to the topic names so the two parameter instances never share a topic, matching the convention used by the other parameterized tests in this file.
lhotari
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ReaderSeekTest.testSeekToEndByTimestampfails intermittently in CI, with all retries also failing, e.g. https://github.com/apache/pulsar-client-cpp/actions/runs/33217535403/job/99004452530:The topic name only uses a second-granularity timestamp (
time(nullptr)), but gtest-parallel runs the/0and/1parameter instances as separate concurrent processes. When both start within the same second they share the same topic. Each process publishes its own message, so one instance's publish can land after the other instance's seek-to-end but before itshasMessageAvailable()check, which then correctly returnstrueand fails the assertion. In the failing job all runs shared the topictest-seek-to-end-by-timestamp-1787958423:/0sought at 23:07:03.184,/1published at ~.248, and/0checked at .285 →true. Retries keep publishing to the same shared topic and poison whichever sibling is mid-seek, so the whole job fails.testHasMessageAvailableAfterSeekToEndhas the same hazard (it also asserts exact message content after seek-to-end).Modifications
Append
GetParam()to the topic names oftestSeekToEndByTimestampandtestHasMessageAvailableAfterSeekToEndso the two parameter instances never share a topic, matching the convention already used by the other parameterized tests in this file.