kirktrue commented on code in PR #16031:
URL: https://github.com/apache/kafka/pull/16031#discussion_r1624997659
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CommitRequestManagerTest.java:
##########
@@ -747,21 +748,19 @@ public void
testOffsetCommitSyncTimeoutNotReturnedOnPollAndFails() {
new TopicPartition("topic", 1),
new OffsetAndMetadata(0));
- // Send sync offset commit request that fails with retriable error.
- long expirationTimeMs = time.milliseconds() + retryBackoffMs * 2;
- CompletableFuture<Void> commitResult =
commitRequestManager.commitSync(offsets, expirationTimeMs);
- completeOffsetCommitRequestWithError(commitRequestManager,
Errors.REQUEST_TIMED_OUT);
+ // Send sync offset commit request.
+ long deadlineMs = time.milliseconds() + retryBackoffMs * 2;
+ CompletableFuture<Void> commitResult =
commitRequestManager.commitSync(offsets, deadlineMs);
- // Request retried after backoff, and fails with retriable again.
Should not complete yet
+ // Make the first request fail with a retriable error. Should not
complete yet
// given that the request timeout hasn't expired.
time.sleep(retryBackoffMs);
completeOffsetCommitRequestWithError(commitRequestManager,
Errors.REQUEST_TIMED_OUT);
assertFalse(commitResult.isDone());
// Sleep to expire the request timeout. Request should fail on the
next poll.
time.sleep(retryBackoffMs);
- NetworkClientDelegate.PollResult res =
commitRequestManager.poll(time.milliseconds());
- assertEquals(0, res.unsentRequests.size());
+ completeOffsetCommitRequestWithError(commitRequestManager,
Errors.REQUEST_TIMED_OUT);
Review Comment:
This code is reverted back to the original form now that we prune expired
requests that have been attempted at least once.
--
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]