spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerryshao <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14455][Streaming] Fix NPE in allocatedE...
Date Sat, 09 Apr 2016 01:48:54 GMT
Github user jerryshao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12236#discussion_r59107996
  
    --- Diff: streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala
---
    @@ -102,6 +102,31 @@ class ReceiverTrackerSuite extends TestSuiteBase {
           }
         }
       }
    +
    +  test("get allocated executors") {
    +    // Test get allocated executors when 1 receiver is registered
    +    withStreamingContext(new StreamingContext(conf, Milliseconds(100))) { ssc =>
    +      val input = ssc.receiverStream(new TestReceiver)
    +      val output = new TestOutputStream(input)
    +      output.register()
    +      ssc.start()
    +      eventually(timeout(10 seconds), interval(10 millis)) {
    +        assert(ssc.scheduler.receiverTracker.allocatedExecutors().size === 1)
    +      }
    +    }
    +
    +    // Test get allocated executors when there's no receiver registered
    +    withStreamingContext(new StreamingContext(conf, Milliseconds(100))) { ssc =>
    +      val rdd = ssc.sc.parallelize(1 to 10)
    +      val input = new ConstantInputDStream(ssc, rdd)
    +      val output = new TestOutputStream(input)
    +      output.register()
    +      ssc.start()
    +      eventually(timeout(10 seconds), interval(10 millis)) {
    +        assert(ssc.scheduler.receiverTracker.allocatedExecutors() === Map.empty)
    --- End diff --
    
    Alright, let me change it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message