You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by da...@apache.org on 2016/03/04 02:46:32 UTC

spark git commit: [SPARK-13601] [TESTS] use 1 partition in tests to avoid race conditions

Repository: spark
Updated Branches:
  refs/heads/master b373a8886 -> d062587dd


[SPARK-13601] [TESTS] use 1 partition in tests to avoid race conditions

## What changes were proposed in this pull request?

Fix race conditions when cleanup files.

## How was this patch tested?

Existing tests.

Author: Davies Liu <da...@databricks.com>

Closes #11507 from davies/flaky.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d062587d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d062587d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d062587d

Branch: refs/heads/master
Commit: d062587dd2c4ed13998ee8bcc9d08f29734df228
Parents: b373a88
Author: Davies Liu <da...@databricks.com>
Authored: Thu Mar 3 17:46:28 2016 -0800
Committer: Davies Liu <da...@gmail.com>
Committed: Thu Mar 3 17:46:28 2016 -0800

----------------------------------------------------------------------
 .../spark/sql/sources/CommitFailureTestRelationSuite.scala    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d062587d/sql/hive/src/test/scala/org/apache/spark/sql/sources/CommitFailureTestRelationSuite.scala
----------------------------------------------------------------------
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/sources/CommitFailureTestRelationSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/sources/CommitFailureTestRelationSuite.scala
index 64c27da..2058705 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/sources/CommitFailureTestRelationSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/sources/CommitFailureTestRelationSuite.scala
@@ -51,7 +51,7 @@ class CommitFailureTestRelationSuite extends SQLTestUtils with TestHiveSingleton
     withTempPath { file =>
       // fail the job in the middle of writing
       val divideByZero = udf((x: Int) => { x / (x - 1)})
-      val df = sqlContext.range(0, 10).select(divideByZero(col("id")))
+      val df = sqlContext.range(0, 10).coalesce(1).select(divideByZero(col("id")))
 
       SimpleTextRelation.callbackCalled = false
       intercept[SparkException] {
@@ -69,7 +69,8 @@ class CommitFailureTestRelationSuite extends SQLTestUtils with TestHiveSingleton
     withTempPath { file =>
       // fail the job in the middle of writing
       val divideByZero = udf((x: Int) => { x / (x - 1)})
-      val df = sqlContext.range(0, 10).select(col("id").mod(2).as("key"), divideByZero(col("id")))
+      val df = sqlContext.range(0, 10).coalesce(1)
+        .select(col("id").mod(2).as("key"), divideByZero(col("id")))
 
       SimpleTextRelation.callbackCalled = false
       intercept[SparkException] {
@@ -87,7 +88,7 @@ class CommitFailureTestRelationSuite extends SQLTestUtils with TestHiveSingleton
     SimpleTextRelation.failCommitter = false
     withTempPath { file =>
       // fail the job in the middle of writing
-      val df = sqlContext.range(0, 10).select(col("id").mod(2).as("key"), col("id"))
+      val df = sqlContext.range(0, 10).coalesce(1).select(col("id").mod(2).as("key"), col("id"))
 
       SimpleTextRelation.callbackCalled = false
       SimpleTextRelation.failWriter = true


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org