Skip to content

Commit 5816489

Browse files
committed
Moved unit test for SPARK-4514 from AsyncRDDActionsSuite into StatusTrackerSuite
This reverts commit 38b1442.
1 parent 38b1442 commit 5816489

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

core/src/test/scala/org/apache/spark/StatusTrackerSuite.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,17 @@ class StatusTrackerSuite extends SparkFunSuite with Matchers with LocalSparkCont
8686
Set(firstJobId, secondJobId))
8787
}
8888
}
89+
90+
test("getJobIdsForGroup() with takeAsync()") {
91+
sc = new SparkContext("local", "test", new SparkConf(false))
92+
sc.setJobGroup("my-job-group2", "description")
93+
sc.statusTracker.getJobIdsForGroup("my-job-group2") should be (Seq.empty)
94+
val firstJobFuture = sc.parallelize(1 to 1000, 1).takeAsync(1)
95+
val firstJobId = eventually(timeout(10 seconds)) {
96+
firstJobFuture.jobIds.head
97+
}
98+
eventually(timeout(10 seconds)) {
99+
sc.statusTracker.getJobIdsForGroup("my-job-group2") should be (Seq(firstJobId))
100+
}
101+
}
89102
}

core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ import scala.concurrent._
2323
import scala.concurrent.duration.Duration
2424
import scala.concurrent.ExecutionContext.Implicits.global
2525

26-
import org.scalatest.{Matchers, BeforeAndAfterAll}
27-
import org.scalatest.concurrent.{Eventually, Timeouts}
26+
import org.scalatest.BeforeAndAfterAll
27+
import org.scalatest.concurrent.Timeouts
2828
import org.scalatest.time.SpanSugar._
2929

3030
import org.apache.spark._
3131

32-
class AsyncRDDActionsSuite extends SparkFunSuite with BeforeAndAfterAll with Timeouts
33-
with Eventually with Matchers {
32+
class AsyncRDDActionsSuite extends SparkFunSuite with BeforeAndAfterAll with Timeouts {
3433

3534
@transient private var sc: SparkContext = _
3635

@@ -228,16 +227,4 @@ class AsyncRDDActionsSuite extends SparkFunSuite with BeforeAndAfterAll with Tim
228227
test("ComplexFutureAction callback must not consume a thread while waiting") {
229228
testAsyncAction((_.takeAsync(100)))
230229
}
231-
232-
test("getJobIdsForGroup() with takeAsync()") {
233-
sc.setJobGroup("my-job-group2", "description")
234-
sc.statusTracker.getJobIdsForGroup("my-job-group2") should be (Seq.empty)
235-
val firstJobFuture = sc.parallelize(1 to 1000, 1).takeAsync(1)
236-
val firstJobId = eventually(timeout(10 seconds)) {
237-
firstJobFuture.jobIds.head
238-
}
239-
eventually(timeout(10 seconds)) {
240-
sc.statusTracker.getJobIdsForGroup("my-job-group2") should be (Seq(firstJobId))
241-
}
242-
}
243230
}

0 commit comments

Comments
 (0)