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-32836][SS][TESTS] Fix DataStreamReaderWriterSuite to check writer options correctly #29701

Closed
wants to merge 1 commit into from

Conversation

dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Sep 10, 2020

What changes were proposed in this pull request?

This PR aims to fix the test coverage at DataStreamReaderWriterSuite.

Why are the changes needed?

Currently, the test case checks DataStreamReader options instead of DataStreamWriter options.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Pass the revised test case.

.format("org.apache.spark.sql.streaming.test")
.option("opt1", "1")
.options(Map("opt2" -> "2"))
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously, the test case used the same options here and line 162~163. This hides this test coverage bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch!

@dongjoon-hyun
Copy link
Member Author

cc @cloud-fan and @HeartSaVioR

@dongjoon-hyun
Copy link
Member Author

Thank you, @cloud-fan !

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

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

LGTM assuming tests will pass.

@dongjoon-hyun
Copy link
Member Author

Thank you, @HeartSaVioR .

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya . Merged to master/3.0/2.4.

dongjoon-hyun added a commit that referenced this pull request Sep 10, 2020
…ter options correctly

### What changes were proposed in this pull request?

This PR aims to fix the test coverage at `DataStreamReaderWriterSuite`.

### Why are the changes needed?

Currently, the test case checks `DataStreamReader` options instead of `DataStreamWriter` options.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the revised test case.

Closes #29701 from dongjoon-hyun/SPARK-32836.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 06a9945)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit that referenced this pull request Sep 10, 2020
…ter options correctly

### What changes were proposed in this pull request?

This PR aims to fix the test coverage at `DataStreamReaderWriterSuite`.

### Why are the changes needed?

Currently, the test case checks `DataStreamReader` options instead of `DataStreamWriter` options.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the revised test case.

Closes #29701 from dongjoon-hyun/SPARK-32836.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 06a9945)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun dongjoon-hyun deleted the SPARK-32836 branch September 10, 2020 02:49
@SparkQA
Copy link

SparkQA commented Sep 10, 2020

Test build #128473 has finished for PR 29701 at commit 82fecaf.

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

@viirya
Copy link
Member

viirya commented Sep 10, 2020

@dongjoon-hyun The test seems not passed?

@dongjoon-hyun
Copy link
Member Author

Ur, let me check again. I checked in IntelliJ and run build/sbt streaming tests locally.

@dongjoon-hyun
Copy link
Member Author

BTW, GitHub Action also passed, so I merged this.

@dongjoon-hyun
Copy link
Member Author

I verified again locally. It works.

Given the error message from Jenkins, the map seems to be overwritten to the read options back again by the streaming query. If not, it should fail before reaching checkpointLocation because we verify assert(LastOptions.parameters("opt1") == "5") before.

sbt.ForkMain$ForkError: org.scalatest.exceptions.TestFailedException: Map("opt3" -> "3", "opt2" -> "2", "opt1" -> "1") did not contain key "checkpointLocation"
	at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:472)

To sum up, this looks like a long-standing flakiness between LastOptions.parameters and the dummy provider class DefaultSource extends StreamSourceProvider with StreamSinkProvider

@dongjoon-hyun
Copy link
Member Author

dongjoon-hyun commented Sep 10, 2020

I'll monitor Jenkins status. BTW, the current GitHub Action result is the following.
Screen Shot 2020-09-09 at 10 05 58 PM

@viirya
Copy link
Member

viirya commented Sep 10, 2020

Ok, I think it is fine as GitHub Actions passed.

@dongjoon-hyun
Copy link
Member Author

Ya. It looks okay for now. branch-2.4 Maven also passed like the following. The branch-3.0 and master Jenkins jobs didn't trigger on this commit yet and those will be terminated during midnight reset (PST).

DataStreamReaderWriterSuite:
- write cannot be called on streaming datasets
- resolve default source
- resolve full class
- options

holdenk pushed a commit to holdenk/spark that referenced this pull request Oct 27, 2020
…ter options correctly

### What changes were proposed in this pull request?

This PR aims to fix the test coverage at `DataStreamReaderWriterSuite`.

### Why are the changes needed?

Currently, the test case checks `DataStreamReader` options instead of `DataStreamWriter` options.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the revised test case.

Closes apache#29701 from dongjoon-hyun/SPARK-32836.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 06a9945)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
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