hachikuji commented on a change in pull request #11097:
URL: https://github.com/apache/kafka/pull/11097#discussion_r674990877
##########
File path: core/src/test/scala/unit/kafka/server/AbstractFetcherThreadTest.scala
##########
@@ -144,6 +144,44 @@ class AbstractFetcherThreadTest {
assertEquals(2L, replicaState.highWatermark)
}
+ @Test
+ def testDelay(): Unit = {
+ val partition = new TopicPartition("topic", 0)
+
+ class ErrorMockFetcherThread(fetchBackOffMs: Int)
+ extends MockFetcherThread(fetchBackOffMs = fetchBackOffMs) {
+
+ override def fetchFromLeader(fetchRequest: FetchRequest.Builder):
Map[TopicPartition, FetchData] = {
+ throw new UnknownTopicIdException("Topic ID was unknown as expected
for this test")
+ }
+ }
+ val fetcher = new ErrorMockFetcherThread(fetchBackOffMs = 1000)
Review comment:
nit: can you create a `val` for `fetchBackoffMs`? Then we can use it
below as well.
Also, could we use a lower value for the backoff? Would that make the test
faster?
--
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]