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

    https://github.com/apache/spark/pull/8402#discussion_r37927038
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
    @@ -695,6 +695,126 @@ class DAGSchedulerSuite
         assertDataStructuresEmpty()
       }
     
    +
    +  // Helper function to validate state when creating tests for task 
failures
    +  def checkStageId(stageId: Int, attempt: Int, stageAttempt: TaskSet) {
    +    assert(stageAttempt.stageId === stageId,
    +      s": expected stage $stageId, got ${stageAttempt.stageId}")
    +    assert(stageAttempt.stageAttemptId == attempt,
    +      s": expected stage attempt $attempt, got 
${stageAttempt.stageAttemptId}")
    +  }
    +
    +  def makeCompletions(stageAttempt: TaskSet, reduceParts: Int): 
Seq[(Success.type, MapStatus)] = {
    +    stageAttempt.tasks.zipWithIndex.map { case (task, idx) =>
    +      (Success, makeMapStatus("host" + ('A' + idx).toChar, reduceParts))
    +    }.toSeq
    +  }
    +
    --- End diff --
    
    I like this too:
    ```scala
    def complete(results: (TaskEndReason, Any)*)
    ```
    Gets rid of a lot of `Seq( ... )` noise at the cost of a few `: _*`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to