You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2024/10/24 18:25:43 UTC
(kafka) branch trunk updated: MINOR: Correct the wrong behavior of TestUtils#verifyTopicDeletion (#17589)
This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 63cdb3602a0 MINOR: Correct the wrong behavior of TestUtils#verifyTopicDeletion (#17589)
63cdb3602a0 is described below
commit 63cdb3602a0d863c24c427d6d1eed10bcec5aa60
Author: TengYao Chi <ki...@gmail.com>
AuthorDate: Fri Oct 25 02:25:36 2024 +0800
MINOR: Correct the wrong behavior of TestUtils#verifyTopicDeletion (#17589)
Reviewers: Chia-Ping Tsai <ch...@gmail.com>
---
core/src/test/scala/unit/kafka/utils/TestUtils.scala | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/core/src/test/scala/unit/kafka/utils/TestUtils.scala b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
index cdfbc1a7b69..04cbd593694 100755
--- a/core/src/test/scala/unit/kafka/utils/TestUtils.scala
+++ b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
@@ -84,7 +84,7 @@ import java.time.Duration
import java.util
import java.util.concurrent._
import java.util.concurrent.atomic.AtomicBoolean
-import java.util.{Arrays, Collections, Optional, Properties}
+import java.util.{Collections, Optional, Properties}
import scala.annotation.nowarn
import scala.collection.mutable.ArrayBuffer
import scala.collection.{Map, Seq, mutable}
@@ -1294,9 +1294,11 @@ object TestUtils extends Logging {
waitUntilTrue(() => brokers.forall(broker =>
broker.config.logDirs.forall { logDir =>
topicPartitions.forall { tp =>
- !Arrays.asList(new File(logDir).list()).asScala.exists { partitionDirectoryName =>
- partitionDirectoryName.startsWith(tp.topic + "-" + tp.partition) &&
- partitionDirectoryName.endsWith(UnifiedLog.DeleteDirSuffix)
+ !util.Arrays.asList(new File(logDir).list()).asScala.exists { partitionDirectoryNames =>
+ partitionDirectoryNames.exists { directoryName =>
+ directoryName.startsWith(tp.topic + "-" + tp.partition) &&
+ directoryName.endsWith(UnifiedLog.DeleteDirSuffix)
+ }
}
}
}