Skip to content

Commit c76c30c

Browse files
committed
fix test
1 parent b355c6d commit c76c30c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -965,14 +965,20 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
965965
}
966966

967967
test("sanity test for SPARK-6618") {
968-
(1 to 100).par.map { i =>
969-
val tableName = s"SPARK_6618_table_$i"
970-
sql(s"CREATE TABLE $tableName (col1 string)")
971-
sessionState.catalog.lookupRelation(TableIdentifier(tableName))
972-
table(tableName)
973-
tables()
974-
sql(s"DROP TABLE $tableName")
968+
val threads: Seq[Thread] = (1 to 100).map { i =>
969+
new Thread("test-thread-" + i) {
970+
override def run(): Unit = {
971+
val tableName = s"SPARK_6618_table_$i"
972+
sql(s"CREATE TABLE $tableName (col1 string)")
973+
sessionState.catalog.lookupRelation(TableIdentifier(tableName))
974+
table(tableName)
975+
tables()
976+
sql(s"DROP TABLE $tableName")
977+
}
978+
}
975979
}
980+
threads.foreach(_.start())
981+
threads.foreach(_.join(10000))
976982
}
977983

978984
test("SPARK-5203 union with different decimal precision") {

0 commit comments

Comments
 (0)