Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Jan 10, 2020

What changes were proposed in this pull request?

In the PR, I propose to define a sub-class of AppenderSkeleton in SparkFunSuite and reuse it from other tests. The class stores incoming LoggingEvent in an array which is available to tests for future analysis of logged events.

Why are the changes needed?

This eliminates code duplication in tests.

Does this PR introduce any user-facing change?

No

How was this patch tested?

By existing test suites - CSVSuite, OptimizerLoggingSuite, JoinHintSuite, CodeGenerationSuite and SQLConfSuite.

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 10, 2020

@maropu Please, review the PR.

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 10, 2020

It follows up #27092 (comment)

@SparkQA
Copy link

SparkQA commented Jan 10, 2020

Test build #116478 has finished for PR 27166 at commit 088c414.

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

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 10, 2020

jenkins, retest this, please

Copy link
Member

@maropu maropu left a comment

Choose a reason for hiding this comment

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

Looks fine if the tests passed, thanks, @MaxGekk ! cc: @dongjoon-hyun @HyukjinKwon

@SparkQA
Copy link

SparkQA commented Jan 10, 2020

Test build #116484 has finished for PR 27166 at commit 088c414.

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

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Jan 10, 2020

Test build #116489 has finished for PR 27166 at commit 088c414.

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

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 10, 2020

I don't think the failure of python tests is related to the PR.

@SparkQA
Copy link

SparkQA commented Jan 10, 2020

Test build #116504 has finished for PR 27166 at commit 6401164.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class FilterStatistics(
  • class EventLogFileCompactor(
  • case class CompactionResult(code: CompactionResultCode.Value, compactIndex: Option[Long])
  • case class AlterNamespaceSetOwner(

@maropu
Copy link
Member

maropu commented Jan 10, 2020

The related thread: #27162

@maropu
Copy link
Member

maropu commented Jan 10, 2020

retest this please

@SparkQA
Copy link

SparkQA commented Jan 10, 2020

Test build #116507 has finished for PR 27166 at commit 6401164.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class FilterStatistics(
  • class EventLogFileCompactor(
  • case class CompactionResult(code: CompactionResultCode.Value, compactIndex: Option[Long])
  • case class AlterNamespaceSetOwner(

@SparkQA
Copy link

SparkQA commented Jan 11, 2020

Test build #116539 has finished for PR 27166 at commit 5ede347.

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

@dongjoon-hyun
Copy link
Member

Retest this please.

@SparkQA
Copy link

SparkQA commented Jan 12, 2020

Test build #116542 has finished for PR 27166 at commit 5ede347.

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

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 12, 2020

Not sure how it is related to my changes:

======================================================================
ERROR: test_memory_limit (pyspark.tests.test_worker.WorkerMemoryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/workspace/SparkPullRequestBuilder/python/pyspark/tests/test_worker.py", line 193, in test_memory_limit
    actual = rdd.map(lambda _: getrlimit()).collect()
  File "/home/jenkins/workspace/SparkPullRequestBuilder/python/pyspark/rdd.py", line 889, in collect
    sock_info = self.ctx._jvm.PythonRDD.collectAndServe(self._jrdd.rdd())
  File "/home/jenkins/workspace/SparkPullRequestBuilder/python/lib/py4j-0.10.8.1-src.zip/py4j/java_gateway.py", line 1286, in __call__
    answer, self.gateway_client, self.target_id, self.name)
  File "/home/jenkins/workspace/SparkPullRequestBuilder/python/lib/py4j-0.10.8.1-src.zip/py4j/protocol.py", line 328, in get_return_value
    format(target_id, ".", name), value)
Py4JJavaError: An error occurred while calling z:org.apache.spark.api.python.PythonRDD.collectAndServe.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, amp-jenkins-worker-05.amp, executor driver): org.apache.spark.SparkException: Python worker exited unexpectedly (crashed)

override def requiresLayout(): Boolean = false
}

private def withLogLevelAndAppender(level: Level, appender: Appender)(f: => Unit): Unit = {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is removed because the method is not used in the test suite.

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 12, 2020

The difference between the master and this PR is some tests could put more log event in log appender like https://github.com/apache/spark/pull/27166/files#diff-5a20f7138b31f3c344a4af7ab6f426daL45 but log appender should be removed at the end of the test. The problem could happen if a log appender is not removed and continue gather other log events.

I will add a check for maximum number of logged events in LogAppender.

@SparkQA
Copy link

SparkQA commented Jan 12, 2020

Test build #116549 has finished for PR 27166 at commit a054624.

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

@HyukjinKwon
Copy link
Member

@MaxGekk, I can't take a close look right now but it might be related to the Jenkins machine itself, and it happens consistently in some machines only. This can be checked via Jenkins log. I plan to check it tomorrow but it might be a good hint for you to investigate further.

@SparkQA
Copy link

SparkQA commented Jan 12, 2020

Test build #116553 has finished for PR 27166 at commit 83b4b70.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class MockAppender extends AppenderSkeleton
  • class MockAppender extends AppenderSkeleton
  • class MockAppender extends AppenderSkeleton
  • class MockAppender extends AppenderSkeleton
  • class TestAppender extends AppenderSkeleton

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 12, 2020

jenkins, retest this, please

@SparkQA
Copy link

SparkQA commented Jan 12, 2020

Test build #116557 has finished for PR 27166 at commit 83b4b70.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class MockAppender extends AppenderSkeleton
  • class MockAppender extends AppenderSkeleton
  • class MockAppender extends AppenderSkeleton
  • class MockAppender extends AppenderSkeleton
  • class TestAppender extends AppenderSkeleton

@SparkQA
Copy link

SparkQA commented Jan 12, 2020

Test build #116565 has finished for PR 27166 at commit 5fc87c4.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class LogAppender(maxEvents: Int = 100) extends AppenderSkeleton

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 12, 2020

I reverted all the changes of this PR, and python tests passed (#27166 (comment)), but when I reverted everything back - the test failed again (#27166 (comment)). At the moment, I cannot figure out how my changes impact on the python test.

@HyukjinKwon
Copy link
Member

retest this please

@HyukjinKwon
Copy link
Member

Should be fixed as of 0823aec ...

@SparkQA
Copy link

SparkQA commented Jan 13, 2020

Test build #116628 has finished for PR 27166 at commit 5fc87c4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class LogAppender(maxEvents: Int = 100) extends AppenderSkeleton

@MaxGekk
Copy link
Member Author

MaxGekk commented Jan 14, 2020

@HyukjinKwon 's fix helped, @maropu this can be merged.

@maropu
Copy link
Member

maropu commented Jan 14, 2020

yea, I will, thanks!

@maropu maropu closed this in 88fc8db Jan 14, 2020
@maropu
Copy link
Member

maropu commented Jan 14, 2020

Merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants