Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/8402#discussion_r38021708
--- 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 --
so after taking a closer look, these extra helper methods are only used in
the `completeNextStage...` helpers (at least, here and in
https://github.com/apache/spark/pull/5636). I I feel like using an implicit
seems a little too heavy for that -- its a pretty minor change to the code, and
it will the code harder to understand for a lot of people. I'd like to try to
at least keep the tests as accessible as possible.
I agree that there are bazillion calls to `complete` that will benefit from
varargs.
---
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]