Skip to content

Commit 601032f

Browse files
concretevitaminmarmbrus
authored andcommitted
HOTFIX: clear() configs in SQLConf-related unit tests.
Thanks goes to @liancheng, who pointed out that `sql/test-only *.SQLConfSuite *.SQLQuerySuite` passed but `sql/test-only *.SQLQuerySuite *.SQLConfSuite` failed. The reason is that some tests use the same test keys and without clear()'ing, they get carried over to other tests. This hotfix simply adds some `clear()` calls. This problem was not evident on Jenkins before probably because `parallelExecution` is not set to `false` for `sqlCoreSettings`. Author: Zongheng Yang <[email protected]> Closes apache#1040 from concretevitamin/sqlconf-tests and squashes the following commits: 6d14ceb [Zongheng Yang] HOTFIX: clear() confs in SQLConf related unit tests.
1 parent a2052a4 commit 601032f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLConfSuite.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class SQLConfSuite extends QueryTest {
2828
val testVal = "test.val.0"
2929

3030
test("programmatic ways of basic setting and getting") {
31+
clear()
3132
assert(getOption(testKey).isEmpty)
3233
assert(getAll.toSet === Set())
3334

@@ -48,6 +49,7 @@ class SQLConfSuite extends QueryTest {
4849
}
4950

5051
test("parse SQL set commands") {
52+
clear()
5153
sql(s"set $testKey=$testVal")
5254
assert(get(testKey, testVal + "_") == testVal)
5355
assert(TestSQLContext.get(testKey, testVal + "_") == testVal)

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ class SQLQuerySuite extends QueryTest {
402402
sql(s"SET $nonexistentKey"),
403403
Seq(Seq(s"$nonexistentKey is undefined"))
404404
)
405+
clear()
405406
}
406407

407408
}

0 commit comments

Comments
 (0)