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

    https://github.com/apache/spark/pull/23181#discussion_r237952479
  
    --- Diff: 
core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala ---
    @@ -1274,47 +1274,69 @@ class AppStatusListenerSuite extends SparkFunSuite 
with BeforeAndAfter {
       }
     
       test("SPARK-25451: total tasks in the executor summary should match 
total stage tasks") {
    -    val testConf = conf.clone.set(LIVE_ENTITY_UPDATE_PERIOD, Long.MaxValue)
     
    -    val listener = new AppStatusListener(store, testConf, true)
    +    val isLiveSeq = Seq(true, false)
     
    -    val stage = new StageInfo(1, 0, "stage", 4, Nil, Nil, "details")
    -    listener.onJobStart(SparkListenerJobStart(1, time, Seq(stage), null))
    -    listener.onStageSubmitted(SparkListenerStageSubmitted(stage, new 
Properties()))
    +    isLiveSeq.foreach { live: Boolean =>
    --- End diff --
    
    When doing things like this I prefer to invert the logic.
    
    ```
    Seq(true, false).foreach { live =>
      test(s"blah blah blah (live = $live)") {
    
      }
    }
    ```


---

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

Reply via email to