kirktrue commented on code in PR #16031:
URL: https://github.com/apache/kafka/pull/16031#discussion_r1618010550
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/TopicMetadataRequestManagerTest.java:
##########
@@ -133,43 +131,6 @@ public void
testAllTopicsExceptionAndInflightRequests(final Errors error, final
}
}
- @Test
- public void testExpiringRequest() {
- String topic = "hello";
-
- // Request topic metadata with 1000ms expiration
- long now = this.time.milliseconds();
- CompletableFuture<Map<String, List<PartitionInfo>>> future =
- this.topicMetadataRequestManager.requestTopicMetadata(topic, now +
1000L);
- assertEquals(1,
this.topicMetadataRequestManager.inflightRequests().size());
-
- // Poll the request manager to get the list of requests to send
- // - fail the request with a RetriableException
- NetworkClientDelegate.PollResult res =
this.topicMetadataRequestManager.poll(this.time.milliseconds());
- assertEquals(1, res.unsentRequests.size());
-
res.unsentRequests.get(0).future().complete(buildTopicMetadataClientResponse(
- res.unsentRequests.get(0),
- topic,
- Errors.REQUEST_TIMED_OUT));
-
- // Sleep for long enough to exceed the backoff delay but still within
the expiration
- // - fail the request again with a RetriableException
- this.time.sleep(500);
- res = this.topicMetadataRequestManager.poll(this.time.milliseconds());
- assertEquals(1, res.unsentRequests.size());
-
res.unsentRequests.get(0).future().complete(buildTopicMetadataClientResponse(
- res.unsentRequests.get(0),
- topic,
- Errors.REQUEST_TIMED_OUT));
-
- // Sleep for long enough to expire the request which should fail
- this.time.sleep(1000);
- res = this.topicMetadataRequestManager.poll(this.time.milliseconds());
- assertEquals(0, res.unsentRequests.size());
- assertEquals(0,
this.topicMetadataRequestManager.inflightRequests().size());
- assertTrue(future.isCompletedExceptionally());
- }
-
Review Comment:
This test exercises the preemptive pruning, which we no longer use.
--
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]