Conversation
…imeout The test declares @test(timeOut = 45 * 1000) but internally waits up to 600 seconds via Awaitility for the replication backlog to drain: Awaitility.await().atMost(Duration.ofSeconds(600)) With 10,000 messages and a 50% probability of injected ManagedLedgerException.TooManyRequestsException, replication takes far longer than 45 seconds (around 150 seconds locally), so the TestNG timeout always fires first and the Awaitility budget is never reachable. Raise the method timeout to 300 seconds so it is consistent with the work the test actually performs, while still keeping a bound on the run time. Other tests in this class already use timeouts up to 240 seconds.
hanmz
requested review from
Jason918,
codelipenghui,
eolivelli,
poorbarcode and
wolfstudy
September 15, 2026 03:07
lhotari
reviewed
Sep 15, 2026
| } | ||
|
|
||
| @Test(timeOut = 45 * 1000) | ||
| @Test(timeOut = 300 * 1000) |
Member
There was a problem hiding this comment.
could we reduce totalMsg instead? CI tests are already too slow.
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
OneWayReplicatorTest.testProbBKErrorWhenReplicatingdeclares a 45 second method timeout:but internally waits up to 600 seconds for the replication backlog to drain:
The test publishes 10,000 messages and injects
ManagedLedgerException.TooManyRequestsExceptionwith 50% probability on every read. Draining the replication backlog under that error injection takes far longer than 45 seconds (around 150 seconds when I ran it locally), so the TestNG timeout always fires first and the 600 second Awaitility budget is unreachable by construction.The result is a
ThreadTimeoutException: Method didn't finish within the time-out 45000rather than a meaningful assertion failure.This 45 second limit has already caused trouble before: #26123 changed
makeReadEntryProbFailto accept a caller-provided executor specifically because routing reads throughForkJoinPool.commonPool()starved this test and made it exceed its 45 second limit on CI. That change removed one source of slowdown, but the underlying mismatch between the declared timeout and the work the test performs was left in place.Modifications
Raise the method timeout from 45 seconds to 300 seconds so it is consistent with the amount of work the test actually performs, while still keeping a bound on the run time.
300 seconds gives roughly a 2x margin over the observed ~150 second runtime, which should absorb slower CI machines without letting a genuinely hung test run indefinitely. Other tests in this class already use timeouts up to 240 seconds, so this is in line with existing practice in the file.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
The modified test was run locally before and after the change:
ThreadTimeoutExceptionat 45s (actual runtime ~150s)Does this pull request potentially affect one of the following parts:
Documentation
doc-not-neededMatching PR in forked repository
PR in forked repository: https://github.com/hanmz/pulsar/pull/new/fix/testProbBKErrorWhenReplicating-timeout