From 71dbf02e45c0573af4bdda9f5864fbd749b56031 Mon Sep 17 00:00:00 2001 From: Dong Lin Date: Wed, 29 Mar 2017 10:00:59 -0700 Subject: [PATCH 1/2] KAFKA-4973; Fix transient failure of AdminClientTest.testDeleteRecordsWithException --- core/src/test/scala/integration/kafka/api/AdminClientTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/scala/integration/kafka/api/AdminClientTest.scala b/core/src/test/scala/integration/kafka/api/AdminClientTest.scala index c9ea05f35d790..b037c251e9074 100644 --- a/core/src/test/scala/integration/kafka/api/AdminClientTest.scala +++ b/core/src/test/scala/integration/kafka/api/AdminClientTest.scala @@ -178,7 +178,7 @@ class AdminClientTest extends IntegrationTestHarness with Logging { // OffsetOutOfRangeException if offset > high_watermark assertEquals(DeleteRecordsResult(-1L, Errors.OFFSET_OUT_OF_RANGE.exception()), client.deleteRecordsBefore(Map((tp, 20))).get()(tp)) // TimeoutException if response is not available within user-specified timeout - assertEquals(DeleteRecordsResult(-1L, Errors.REQUEST_TIMED_OUT.exception()), client.deleteRecordsBefore(Map((tp, 5L))).get(0, TimeUnit.MILLISECONDS)(tp)) + assertEquals(DeleteRecordsResult(-1L, Errors.REQUEST_TIMED_OUT.exception()), client.deleteRecordsBefore(Map((tp, 8L))).get(0, TimeUnit.MILLISECONDS)(tp)) val nonExistPartition = new TopicPartition(topic, 3) // UnknownTopicOrPartitionException if user tries to delete records of a non-existent partition From 2ecd938b1bcec9a0e671e430759c426edef9e221 Mon Sep 17 00:00:00 2001 From: Dong Lin Date: Wed, 29 Mar 2017 16:51:33 -0700 Subject: [PATCH 2/2] Remove an assertion --- core/src/test/scala/integration/kafka/api/AdminClientTest.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/test/scala/integration/kafka/api/AdminClientTest.scala b/core/src/test/scala/integration/kafka/api/AdminClientTest.scala index b037c251e9074..d9822cd29a29a 100644 --- a/core/src/test/scala/integration/kafka/api/AdminClientTest.scala +++ b/core/src/test/scala/integration/kafka/api/AdminClientTest.scala @@ -177,8 +177,6 @@ class AdminClientTest extends IntegrationTestHarness with Logging { assertEquals(DeleteRecordsResult(5L, null), client.deleteRecordsBefore(Map((tp, 5L))).get()(tp)) // OffsetOutOfRangeException if offset > high_watermark assertEquals(DeleteRecordsResult(-1L, Errors.OFFSET_OUT_OF_RANGE.exception()), client.deleteRecordsBefore(Map((tp, 20))).get()(tp)) - // TimeoutException if response is not available within user-specified timeout - assertEquals(DeleteRecordsResult(-1L, Errors.REQUEST_TIMED_OUT.exception()), client.deleteRecordsBefore(Map((tp, 8L))).get(0, TimeUnit.MILLISECONDS)(tp)) val nonExistPartition = new TopicPartition(topic, 3) // UnknownTopicOrPartitionException if user tries to delete records of a non-existent partition