Skip to content

[SPARK-28931][CORE][TESTS] Fix couple of bugs in FsHistoryProviderSuite#25629

Closed
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
HeartSaVioR:MINOR-FIX-FsHistoryProviderSuite
Closed

[SPARK-28931][CORE][TESTS] Fix couple of bugs in FsHistoryProviderSuite#25629
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
HeartSaVioR:MINOR-FIX-FsHistoryProviderSuite

Conversation

@HeartSaVioR
Copy link
Contributor

@HeartSaVioR HeartSaVioR commented Aug 30, 2019

What changes were proposed in this pull request?

This patch fixes the bugs in test code itself, FsHistoryProviderSuite.

  1. When creating log file via newLogFile, codec is ignored, leading to wrong file name. (No one tends to create test for test code, as well as the bug doesn't affect existing tests indeed, so not easy to catch.)
  2. When writing events to log file via writeFile, metadata (in case of new format) gets written to file regardless of its codec, and the content is overwritten by another stream, hence no information for Spark version is available. It affects existing test, hence we have wrong expected value to workaround the bug.

This patch also removes redundant parameter isNewFormat in writeFile, as according to review comment, Spark no longer supports old format.

Why are the changes needed?

Explained in above section why they're bugs, though they only reside in test-code. (Please note that the bug didn't come from non-test side of code.)

Does this PR introduce any user-facing change?

No

How was this patch tested?

Modified existing UTs, as well as read event log file in console to see metadata is not overwritten by other contents.

@HeartSaVioR
Copy link
Contributor Author

I've found the bug while working on SPARK-28869. While it doesn't make test failures in master branch, it triggers failures on my work so just propose the fix earlier.

@SparkQA
Copy link

SparkQA commented Aug 30, 2019

Test build #109939 has finished for PR 25629 at commit 6de02ca.

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

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Aug 30, 2019

Nice, @HeartSaVioR .

  • This bug fix is worthy to have a JIRA issue. Could you file a JIRA?
  • And, we use [TESTS] for test only PR. I added it.

@dongjoon-hyun
Copy link
Member

I'll review after that.

@dongjoon-hyun
Copy link
Member

Also, cc @vanzin

@dongjoon-hyun dongjoon-hyun changed the title [MINOR][CORE] Fix couple of bugs in FsHistoryProviderSuite [MINOR][CORE][TEST] Fix couple of bugs in FsHistoryProviderSuite Aug 30, 2019
@dongjoon-hyun dongjoon-hyun changed the title [MINOR][CORE][TEST] Fix couple of bugs in FsHistoryProviderSuite [MINOR][CORE][TESTS] Fix couple of bugs in FsHistoryProviderSuite Aug 30, 2019
@HeartSaVioR HeartSaVioR changed the title [MINOR][CORE][TESTS] Fix couple of bugs in FsHistoryProviderSuite [SPARK-28931][CORE][TESTS] Fix couple of bugs in FsHistoryProviderSuite Aug 30, 2019
@HeartSaVioR
Copy link
Contributor Author

Thanks @dongjoon-hyun , I just filed the JIRA issue and modified the title.

@@ -1256,12 +1257,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging {
val cstream = codec.map(_.compressedOutputStream(fstream)).getOrElse(fstream)
val bstream = new BufferedOutputStream(cstream)
if (isNewFormat) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't support the old log format anymore, so you could actually remove this parameter since you're here...

@SparkQA
Copy link

SparkQA commented Aug 30, 2019

Test build #109965 has finished for PR 25629 at commit c11b50d.

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

@dongjoon-hyun
Copy link
Member

Ur, it's relevant failure. Although I'll trigger this once more, could you take a look?

org.apache.spark.scheduler.ReplayListenerSuite.End-to-end replay with compression

@dongjoon-hyun
Copy link
Member

Retest this please.

@HeartSaVioR
Copy link
Contributor Author

HeartSaVioR commented Aug 31, 2019

It seems to be known flaky - https://issues.apache.org/jira/browse/SPARK-28770 - and not related to this patch , though it occurs frequently. (not really in history, failed couple of times but not often https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/109965/testReport/junit/org.apache.spark.scheduler/ReplayListenerSuite/End_to_end_replay_with_compression/history)

@SparkQA
Copy link

SparkQA commented Aug 31, 2019

Test build #109977 has finished for PR 25629 at commit c11b50d.

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

@HeartSaVioR
Copy link
Contributor Author

Test failure for 109977 is org.apache.spark.sql.hive.client.HiveClientSuites.(It is not a test it is a sbt.testing.SuiteSelector)

@HeartSaVioR
Copy link
Contributor Author

retest this, please

@SparkQA
Copy link

SparkQA commented Aug 31, 2019

Test build #109981 has finished for PR 25629 at commit c11b50d.

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

HeartSaVioR added a commit to HeartSaVioR/spark that referenced this pull request Sep 3, 2019
@HeartSaVioR
Copy link
Contributor Author

cc. @felixcheung as this patch is a part of work in SPARK-28869 (found this during working)

@vanzin
Copy link
Contributor

vanzin commented Sep 4, 2019

Merging to master.

@vanzin vanzin closed this in 712874f Sep 4, 2019
@HeartSaVioR
Copy link
Contributor Author

Thanks all for reviewing and merging!

@HeartSaVioR HeartSaVioR deleted the MINOR-FIX-FsHistoryProviderSuite branch September 4, 2019 18:06
PavithraRamachandran pushed a commit to PavithraRamachandran/spark that referenced this pull request Jun 7, 2022
This patch fixes the bugs in test code itself, FsHistoryProviderSuite.

1. When creating log file via `newLogFile`, codec is ignored, leading to wrong file name. (No one tends to create test for test code, as well as the bug doesn't affect existing tests indeed, so not easy to catch.)
2. When writing events to log file via `writeFile`, metadata (in case of new format) gets written to file regardless of its codec, and the content is overwritten by another stream, hence no information for Spark version is available. It affects existing test, hence we have wrong expected value to workaround the bug.

This patch also removes redundant parameter `isNewFormat` in `writeFile`, as according to review comment, Spark no longer supports old format.

Explained in above section why they're bugs, though they only reside in test-code. (Please note that the bug didn't come from non-test side of code.)

No

Modified existing UTs, as well as read event log file in console to see metadata is not overwritten by other contents.

Closes apache#25629 from HeartSaVioR/MINOR-FIX-FsHistoryProviderSuite.

Authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan@gmail.com>
Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
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