Skip to content

Commit 6eeb7f1

Browse files
committed
Wait until executors are up before running jobs
1 parent d375c8a commit 6eeb7f1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

repl/scala-2.11/src/test/scala/org/apache/spark/repl/ReplSuite.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,15 @@ class ReplSuite extends SparkFunSuite {
399399
test("replicating blocks of object with class defined in repl") {
400400
val output = runInterpreter("local-cluster[2,1,1024]",
401401
"""
402+
|val timeout = 60000 // 60 seconds
403+
|val start = System.currentTimeMillis
404+
|while(sc.getExecutorStorageStatus.size != 3 &&
405+
| (System.currentTimeMillis - start) < timeout) {
406+
| Thread.sleep(10)
407+
|}
408+
|if (System.currentTimeMillis - start >= timeout) {
409+
| throw new java.util.concurrent.TimeoutException("Executors were not up in 60 seconds")
410+
|}
402411
|import org.apache.spark.storage.StorageLevel._
403412
|case class Foo(i: Int)
404413
|val ret = sc.parallelize((1 to 100).map(Foo), 10).persist(MEMORY_AND_DISK_2)

0 commit comments

Comments
 (0)