Skip to content

[SPARK-31847][CORE][TESTS] DAGSchedulerSuite: Rewrite the test framework to support apply specified spark configurations.#28917

Closed
beliefer wants to merge 6 commits intoapache:masterfrom
beliefer:extend-test-frame
Closed

[SPARK-31847][CORE][TESTS] DAGSchedulerSuite: Rewrite the test framework to support apply specified spark configurations.#28917
beliefer wants to merge 6 commits intoapache:masterfrom
beliefer:extend-test-frame

Conversation

@beliefer
Copy link
Contributor

What changes were proposed in this pull request?

DAGSchedulerSuite exists some issue:
afterEach and init are called when the SparkConf of the default SparkContext has no configuration that the test case must set. This causes the SparkContext initialized in beforeEach to be discarded without being used, resulting in waste. On the other hand, the flexibility to add configurations to SparkConf should be addressed by the test framework.

Why are the changes needed?

  1. Reduce overhead about init SparkContext.
  2. Rewrite the test framework to support apply specified spark configurations.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Jenkins test.

@SparkQA
Copy link

SparkQA commented Jun 24, 2020

Test build #124472 has finished for PR 28917 at commit a1c3bb8.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

testWithSparkConf(testName, testTags: _*)()(testFun)(pos)
}

protected def testWithSparkConf(testName: String, testTags: Tag*)
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we just need testWithSparkConf alone. Can we just have this as a private function alone?

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

@SparkQA
Copy link

SparkQA commented Jun 24, 2020

Test build #124474 has finished for PR 28917 at commit 4102f02.

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

@SparkQA
Copy link

SparkQA commented Jun 28, 2020

Test build #124587 has finished for PR 28917 at commit 350fa8d.

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

testWithSparkConf(testName, testTags: _*)()(testFun)(pos)
}

private def testWithSparkConf(testName: String, testTags: Tag*)
Copy link
Member

Choose a reason for hiding this comment

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

Shall we simulate the usage of withSQLConf instead of integrating the confs with test()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most SQL-related configuration parameters can be changed dynamically, but most of Core's parameters are static.

}

/** Sets all configurations specified in `pairs`, calls `init`, and then calls `testFun` */
private def withSparkConf(pairs: (String, String)*)(testFun: => Any): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

For test(), withSparkConf(), shall we extract them into a base class? I guess they could be used by other test suites 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. I will simulate SQLHelper.

private def withSparkConf(pairs: (String, String)*)(testFun: => Any): Unit = {
val conf = new SparkConf()
pairs.foreach(kv => conf.set(kv._1, kv._2))
init(conf)
Copy link
Member

Choose a reason for hiding this comment

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

init() is specific to DAGSchedulerSuite, we should separate it from the test framework.

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.

@SparkQA
Copy link

SparkQA commented Jun 30, 2020

Test build #124661 has finished for PR 28917 at commit da6a9f7.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 1, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 1, 2020

Test build #124723 has finished for PR 28917 at commit da6a9f7.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 1, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 1, 2020

Test build #124730 has finished for PR 28917 at commit da6a9f7.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 1, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 1, 2020

Test build #124738 has finished for PR 28917 at commit da6a9f7.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 1, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 1, 2020

Test build #124756 has finished for PR 28917 at commit da6a9f7.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 2, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 2, 2020

Test build #124841 has finished for PR 28917 at commit da6a9f7.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 2, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 2, 2020

Test build #124851 has finished for PR 28917 at commit da6a9f7.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 2, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 2, 2020

Test build #124852 has finished for PR 28917 at commit da6a9f7.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

beliefer commented Jul 2, 2020

retest this please.

@SparkQA
Copy link

SparkQA commented Jul 2, 2020

Test build #124854 has finished for PR 28917 at commit da6a9f7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait SparkConfHelper

@beliefer
Copy link
Contributor Author

cc @jiangxb1987

@SparkQA
Copy link

SparkQA commented Jul 14, 2020

Test build #125808 has finished for PR 28917 at commit ec0d8d0.

  • 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 Jul 14, 2020

Test build #125814 has finished for PR 28917 at commit ec0d8d0.

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

@SparkQA
Copy link

SparkQA commented Jul 14, 2020

Test build #125822 has finished for PR 28917 at commit b060daa.

  • This patch fails PySpark pip packaging tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@beliefer
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Jul 14, 2020

Test build #125842 has finished for PR 28917 at commit b060daa.

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

@beliefer beliefer force-pushed the extend-test-frame branch from b060daa to ec0d8d0 Compare July 15, 2020 07:43
@SparkQA
Copy link

SparkQA commented Jul 15, 2020

Test build #125897 has finished for PR 28917 at commit ec0d8d0.

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

@beliefer
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Jul 17, 2020

Test build #126022 has finished for PR 28917 at commit ec0d8d0.

  • 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 Jul 17, 2020

Test build #126041 has finished for PR 28917 at commit ec0d8d0.

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

@beliefer
Copy link
Contributor Author

cc @jiangxb1987 @Ngone51

@beliefer
Copy link
Contributor Author

Because conflicts, I will close this PR.

@beliefer beliefer closed this Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants