Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Apr 8, 2014
1 parent be50246 commit 4991af6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions core/src/test/scala/org/apache/spark/FailureSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ class FailureSuite extends FunSuite with LocalSparkContext {
throw new Exception("Intentional task failure")
}
}
(k, v(0) * v(0))
val vHead = v.next()
(k, vHead * vHead)
}.collect()
FailureSuiteState.synchronized {
assert(FailureSuiteState.tasksRun === 4)
Expand Down Expand Up @@ -137,5 +138,3 @@ class FailureSuite extends FunSuite with LocalSparkContext {

// TODO: Need to add tests with shuffle fetch failures.
}


2 changes: 1 addition & 1 deletion core/src/test/scala/org/apache/spark/PipedRDDSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PipedRDDSuite extends FunSuite with SharedSparkContext {
(f: String => Unit) => {
bl.value.map(f(_)); f("\u0001")
},
(i: Tuple2[String, Seq[String]], f: String => Unit) => {
(i: Tuple2[String, Iterator[String]], f: String => Unit) => {
for (e <- i._2) {
f(e + "_")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class BasicOperationsSuite extends TestSuiteBase {
testOperation(
Seq( Seq("a", "a", "b"), Seq("", ""), Seq() ),
(s: DStream[String]) => s.map(x => (x, 1)).groupByKey(),
Seq( Seq(("a", Seq(1, 1)), ("b", Seq(1))), Seq(("", Seq(1, 1))), Seq() ),
Seq( Seq(("a", Seq(1, 1).toIterator), ("b", Seq(1).toIterator)), Seq(("", Seq(1, 1).toIterator)), Seq() ),
true
)
}
Expand Down Expand Up @@ -245,9 +245,9 @@ class BasicOperationsSuite extends TestSuiteBase {
val inputData1 = Seq( Seq("a", "a", "b"), Seq("a", ""), Seq(""), Seq() )
val inputData2 = Seq( Seq("a", "a", "b"), Seq("b", ""), Seq(), Seq() )
val outputData = Seq(
Seq( ("a", (Seq(1, 1), Seq("x", "x"))), ("b", (Seq(1), Seq("x"))) ),
Seq( ("a", (Seq(1), Seq())), ("b", (Seq(), Seq("x"))), ("", (Seq(1), Seq("x"))) ),
Seq( ("", (Seq(1), Seq())) ),
Seq( ("a", (Seq(1, 1).toIterator, Seq("x", "x"))).toIterator, ("b", (Seq(1).toIterator, Seq("x").toIterator)) ),
Seq( ("a", (Seq(1).toIterator, Seq())).toIterator, ("b", (Seq().toIterator, Seq("x").toIterator)), ("", (Seq(1).toIterator, Seq("x").toIterator)) ),
Seq( ("", (Seq(1).toIterator, Seq().toIterator)) ),
Seq( )
)
val operation = (s1: DStream[String], s2: DStream[String]) => {
Expand Down

0 comments on commit 4991af6

Please sign in to comment.