Skip to content
Snippets Groups Projects
Commit 7d6c8715 authored by Eric Liang's avatar Eric Liang Committed by Reynold Xin
Browse files

[SPARK-18167][SQL] Retry when the SQLQuerySuite test flakes

## What changes were proposed in this pull request?

This will re-run the flaky test a few times after it fails. This will help determine if it's due to nondeterministic test setup, or because of some environment issue (e.g. leaked config from another test).

cc yhuai

Author: Eric Liang <ekl@databricks.com>

Closes #15708 from ericl/spark-18167-3.
parent efc254a8
No related branches found
No related tags found
No related merge requests found
...@@ -1566,14 +1566,26 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton { ...@@ -1566,14 +1566,26 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
} }
test("SPARK-10562: partition by column with mixed case name") { test("SPARK-10562: partition by column with mixed case name") {
withTable("tbl10562") { def runOnce() {
val df = Seq(2012 -> "a").toDF("Year", "val") withTable("tbl10562") {
df.write.partitionBy("Year").saveAsTable("tbl10562") val df = Seq(2012 -> "a").toDF("Year", "val")
checkAnswer(sql("SELECT year FROM tbl10562"), Row(2012)) df.write.partitionBy("Year").saveAsTable("tbl10562")
checkAnswer(sql("SELECT Year FROM tbl10562"), Row(2012)) checkAnswer(sql("SELECT year FROM tbl10562"), Row(2012))
checkAnswer(sql("SELECT yEAr FROM tbl10562"), Row(2012)) checkAnswer(sql("SELECT Year FROM tbl10562"), Row(2012))
checkAnswer(sql("SELECT val FROM tbl10562 WHERE Year > 2015"), Nil) checkAnswer(sql("SELECT yEAr FROM tbl10562"), Row(2012))
checkAnswer(sql("SELECT val FROM tbl10562 WHERE Year == 2012"), Row("a")) checkAnswer(sql("SELECT val FROM tbl10562 WHERE Year > 2015"), Nil)
checkAnswer(sql("SELECT val FROM tbl10562 WHERE Year == 2012"), Row("a"))
}
}
try {
runOnce()
} catch {
case t: Throwable =>
// Retry to gather more test data. TODO(ekl) revert this once we deflake this test.
runOnce()
runOnce()
runOnce()
throw t
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment