diff options
author | Eric Liang <ekl@databricks.com> | 2016-10-31 20:23:22 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-10-31 20:23:22 -0700 |
commit | 7d6c87155c740cf622c2c600a8ca64154d24c422 (patch) | |
tree | c03755c831f6806b731b3b1aa0cf3f0f93851054 /sql/hive | |
parent | efc254a82bc3331d78023f00d29d4c4318dfb734 (diff) | |
download | spark-7d6c87155c740cf622c2c600a8ca64154d24c422.tar.gz spark-7d6c87155c740cf622c2c600a8ca64154d24c422.tar.bz2 spark-7d6c87155c740cf622c2c600a8ca64154d24c422.zip |
[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.
Diffstat (limited to 'sql/hive')
-rw-r--r-- | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala index 2735d3a526..f64010a64b 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala @@ -1566,14 +1566,26 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton { } test("SPARK-10562: partition by column with mixed case name") { - withTable("tbl10562") { - val df = Seq(2012 -> "a").toDF("Year", "val") - 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 val FROM tbl10562 WHERE Year > 2015"), Nil) - checkAnswer(sql("SELECT val FROM tbl10562 WHERE Year == 2012"), Row("a")) + def runOnce() { + withTable("tbl10562") { + val df = Seq(2012 -> "a").toDF("Year", "val") + 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 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 } } |