Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8781#discussion_r39926209
  
    --- Diff: 
streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala 
---
    @@ -180,6 +180,38 @@ class StreamingContextSuite extends SparkFunSuite with 
BeforeAndAfter with Timeo
         assert(ssc.scheduler.isStarted === false)
       }
     
    +  test("start should set job group correctly") {
    +    ssc = new StreamingContext(conf, batchDuration)
    +    ssc.sc.setJobGroup("non-streaming", "non-streaming", true)
    +    val sc = ssc.sc
    +
    +    @volatile var jobGroupFound: String = ""
    +    @volatile var jobDescFound: String = ""
    +    @volatile var jobInterruptFound: String = ""
    +    @volatile var allFound: Boolean = false
    +
    +    addInputStream(ssc).foreachRDD { rdd =>
    +      jobGroupFound = sc.getLocalProperty(SparkContext.SPARK_JOB_GROUP_ID)
    +      jobDescFound = 
sc.getLocalProperty(SparkContext.SPARK_JOB_DESCRIPTION)
    +      jobInterruptFound = 
sc.getLocalProperty(SparkContext.SPARK_JOB_INTERRUPT_ON_CANCEL)
    +      allFound = true
    +    }
    +    ssc.start()
    +
    +    eventually(timeout(5 seconds), interval(10 milliseconds)) {
    +      assert(allFound === true)
    +    }
    --- End diff --
    
    Well, in both cases, one has to go and fix the test :) Anyways not going 
into the argument of eventually vs block permanently. I think its better to use 
eventually with conservative timeouts, than block completely. I am fairly 
certain that this test is fine. Other tests in this suite also uses same 
eventually and they have not been flaky (the few times StreamingContextSuite 
has been flaky, they were for one test which had a real bug, not for 
eventually). I can make the timeout even more conservative, no harm in that.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to