From 297d5cfd211f909c648da92a7e951b8cd30189be Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Thu, 15 Feb 2024 13:02:19 -0700 Subject: [PATCH] make temp dir more robust --- .../src/test/scala/org/apache/comet/CometCastSuite.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spark/src/test/scala/org/apache/comet/CometCastSuite.scala b/spark/src/test/scala/org/apache/comet/CometCastSuite.scala index 32b439c4f..0820143d2 100644 --- a/spark/src/test/scala/org/apache/comet/CometCastSuite.scala +++ b/spark/src/test/scala/org/apache/comet/CometCastSuite.scala @@ -31,7 +31,13 @@ import org.apache.spark.sql.types.{DataType, DataTypes} class CometCastSuite extends CometTestBase with AdaptiveSparkPlanHelper { import testImplicits._ - private val tempDir = Files.createTempDirectory("CometCastSuite") + private lazy val tempDir = { + val tmp = Files.createTempDirectory("CometCastSuite") + if (!tmp.toFile.exists()) { + assert(tmp.toFile.mkdirs()) + } + tmp + } ignore("cast long to short") { castTest(generateLongs, DataTypes.ShortType)