Skip to content

Commit 9729845

Browse files
committed
fix
1 parent 83b27d2 commit 9729845

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/PaimonHiveTestBase.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ package org.apache.paimon.spark
2121
import org.apache.paimon.hive.TestHiveMetastore
2222
import org.apache.paimon.table.FileStoreTable
2323

24-
import javolution.util.ReentrantLock
2524
import org.apache.hadoop.conf.Configuration
2625
import org.apache.spark.SparkConf
2726
import org.apache.spark.sql.paimon.Utils
2827

2928
import java.io.File
30-
import java.util.concurrent.ThreadLocalRandom
29+
import java.util.concurrent.{ThreadLocalRandom, TimeUnit}
30+
import java.util.concurrent.locks.ReentrantLock
3131

3232
class PaimonHiveTestBase extends PaimonSparkTestBase {
3333

@@ -61,7 +61,7 @@ class PaimonHiveTestBase extends PaimonSparkTestBase {
6161
}
6262

6363
override protected def beforeAll(): Unit = {
64-
lock.lock()
64+
lock.tryLock(10, TimeUnit.MINUTES)
6565
testHiveMetastore.start(hivePort)
6666
super.beforeAll()
6767
spark.sql(s"USE $sparkCatalogName")
@@ -73,10 +73,10 @@ class PaimonHiveTestBase extends PaimonSparkTestBase {
7373
spark.sql(s"USE $sparkCatalogName")
7474
spark.sql("USE default")
7575
spark.sql(s"DROP DATABASE $hiveDbName CASCADE")
76-
lock.unlock()
7776
} finally {
7877
super.afterAll()
7978
testHiveMetastore.stop()
79+
lock.unlock()
8080
}
8181
}
8282

0 commit comments

Comments
 (0)