kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjko...@apache.org
Subject [13/37] git commit: KAFKA-1258 Automatically delete temporary directories with a shutdown hook during tests to avoid leaking temp files. Patch by Manikumar Reddy.
Date Tue, 05 Aug 2014 23:00:10 GMT
KAFKA-1258 Automatically delete temporary directories with a shutdown hook during tests to
avoid leaking temp files. Patch by Manikumar Reddy.


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/4b3d03e8
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/4b3d03e8
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/4b3d03e8

Branch: refs/heads/transactional_messaging
Commit: 4b3d03e8e0d660b27c7823c03dde075d6ce8348b
Parents: 83a9aa5
Author: Jay Kreps <jay.kreps@gmail.com>
Authored: Sat Jul 12 12:49:04 2014 -0700
Committer: Jay Kreps <jay.kreps@gmail.com>
Committed: Sat Jul 12 12:49:04 2014 -0700

----------------------------------------------------------------------
 core/src/test/scala/unit/kafka/utils/TestUtils.scala | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/4b3d03e8/core/src/test/scala/unit/kafka/utils/TestUtils.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/utils/TestUtils.scala b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
index 57b2bd5..3faa884 100644
--- a/core/src/test/scala/unit/kafka/utils/TestUtils.scala
+++ b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
@@ -84,6 +84,13 @@ object TestUtils extends Logging {
     val f = new File(IoTmpDir, "kafka-" + random.nextInt(1000000))
     f.mkdirs()
     f.deleteOnExit()
+
+    Runtime.getRuntime().addShutdownHook(new Thread() {
+      override def run() = {
+        Utils.rm(f)
+      }
+    })
+    
     f
   }
 


Mime
View raw message