Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-32875][CORE][TEST] TaskSchedulerImplSuite: For the pattern of submitTasks + resourceOffers + assert, extract the general method. #29754

Conversation

beliefer
Copy link
Contributor

What changes were proposed in this pull request?

TaskSchedulerImplSuite always check the results show below:

   val zeroCoreWorkerOffers = IndexedSeq(new WorkerOffer("executor0", "host0", 0),
      new WorkerOffer("executor1", "host1", 0))
    val taskSet = FakeTask.createTaskSet(1)
    taskScheduler.submitTasks(taskSet)
    var taskDescriptions = taskScheduler.resourceOffers(zeroCoreWorkerOffers).flatten
    assert(0 === taskDescriptions.length)

We can extract it as a generic method.

Why are the changes needed?

Extract a generic method.

Does this PR introduce any user-facing change?

'No'.

How was this patch tested?

Jenkins test

@SparkQA
Copy link

SparkQA commented Sep 15, 2020

Test build #128694 has finished for PR 29754 at commit 4240990.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Sep 15, 2020

Test build #128705 has finished for PR 29754 at commit 4240990.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Sep 16, 2020

Test build #128759 has finished for PR 29754 at commit 4240990.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer beliefer changed the title [WIP][SPARK-32875][CORE][TEST] TaskSchedulerImplSuite: For the pattern of submitTasks + resourceOffers + assert, extract the general method. [SPARK-32875][CORE][TEST] TaskSchedulerImplSuite: For the pattern of submitTasks + resourceOffers + assert, extract the general method. Sep 17, 2020
private def submitTasksAndCheck(
offers: IndexedSeq[WorkerOffer],
taskSets: Seq[TaskSet] = Seq(FakeTask.createTaskSet(1)),
taskSchedulerOpt: Option[TaskSchedulerImpl] = None) (f: Seq[TaskDescription] => Any): Any = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the global taskScheduler as the default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@@ -140,6 +140,16 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B
taskScheduler
}

private def submitTasksAndCheck(
offers: IndexedSeq[WorkerOffer],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that many tests use the same WorkerOffer, e.g., WorkerOffer("executor0", "host0", 1). Shall we make it as the default value as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

assert(taskDescriptions.map(_.index).sorted == Seq(0, 1))
assert(manager.copiesRunning.take(2) === Array(1, 1))
submitTasksAndCheck(IndexedSeq(WorkerOffer("executor2", "host2", 1),
WorkerOffer("executor3", "host3", 1)), Seq.empty) { taskDescriptions =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I feel it's weird that we're submitting empty task sets here... submitTasksAndCheck maybe not appropriate for this case? Or you could redesign the submitTasksAndCheck?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Let's not change this matter.

@SparkQA
Copy link

SparkQA commented Sep 22, 2020

Test build #128971 has finished for PR 29754 at commit 57e8eb6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

cc @dongjoon-hyun

@SparkQA
Copy link

SparkQA commented Nov 30, 2020

Test build #131975 has finished for PR 29754 at commit 15c63c3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

beliefer commented Dec 3, 2020

retest this please

@SparkQA
Copy link

SparkQA commented Dec 3, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/36711/

@SparkQA
Copy link

SparkQA commented Dec 3, 2020

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/36711/

@SparkQA
Copy link

SparkQA commented Dec 3, 2020

Test build #132112 has finished for PR 29754 at commit 15c63c3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

cc @jiangxb1987

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Mar 22, 2021
@beliefer
Copy link
Contributor Author

cc @jiangxb1987

@dongjoon-hyun
Copy link
Member

Since the author (@beliefer ) is active, I removed the Stale tag and reopen this PR.

@beliefer , could you resolve the conflicts?

@beliefer
Copy link
Contributor Author

@beliefer , could you resolve the conflicts?
@dongido001 Thanks!

@SparkQA
Copy link

SparkQA commented Mar 23, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40959/

@SparkQA
Copy link

SparkQA commented Mar 23, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40959/

@SparkQA
Copy link

SparkQA commented Mar 23, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40962/

@SparkQA
Copy link

SparkQA commented Mar 23, 2021

Test build #136373 has finished for PR 29754 at commit 15c63c3.

  • This patch fails SparkR unit tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Mar 23, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40962/

@SparkQA
Copy link

SparkQA commented Mar 23, 2021

Test build #136378 has finished for PR 29754 at commit f5229e6.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

cc @jiangxb1987

@github-actions
Copy link

github-actions bot commented Jul 2, 2021

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jul 2, 2021
@github-actions github-actions bot closed this Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants