rishi-rana opened a new pull request, #23679:
URL: https://github.com/apache/kafka/pull/23679

   ## Summary
   
   `testFenceMultipleBrokers` used a 1000ms session timeout while relying on the
   test harness's 100ms heartbeat resend interval 
(`TestUtils.DEFAULT_POLL_INTERVAL_MS`)
   to keep `brokersToKeepUnfenced` alive while waiting for `brokersToFence` to 
time out.
   
   Under normal conditions this gives a ~10x margin, but under CI load (GC 
pauses,
   scheduler contention) that margin can be exhausted between heartbeat resends,
   causing a broker that should stay unfenced to be spuriously fenced instead —
   matching the intermittent failure reported in this ticket.
   
   - Raise `sessionTimeoutMillis` from 1000ms to 2000ms for this test, matching
     the value already used by the structurally identical 
`testBalancePartitionLeaders`
     in the same file, which has not been reported flaky.
   - No production code changes; this only widens the real-time margin in the 
test.
   
   Note: this is a reasoned fix based on tracing the timing mechanism in code
   (confirmed `QuorumControllerTestEnv` uses `Time.SYSTEM` with no mock-time
   injection point, and confirmed the 100ms-poll-vs-1000ms-timeout margin), not
   a locally reproduced failure — the race is inherently load-dependent and did
   not reproduce in repeated clean local runs on an idle machine.
   
   Developed with AI assistance.
   
   ## Test plan
   
   - [x] `./gradlew metadata:test --tests 
"org.apache.kafka.controller.QuorumControllerTest"` — full suite passes
   - [x] `./gradlew :metadata:spotlessCheck :metadata:checkstyleTest` — clean


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to