Skip to content

Conversation

@HeartSaVioR
Copy link
Contributor

What changes were proposed in this pull request?

This patch leverages V2 continuous memory stream to extract tests from Kafka micro-batch sink suite and continuous sink suite and deduplicate them. These tests are basically doing the same, except how to run and verify the result.

Why are the changes needed?

We no longer have same tests spotted on two places - brings 300 lines deletion.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing UTs.

}
}

test("streaming - write aggregation w/o topic field, with topic option") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We simplify the query because aggregation is not needed for testing origin intention, as well as aggregation is not supported in continuous mode.

}
}

test("streaming - aggregation with topic field and topic option") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here.


override protected def defaultTrigger: Option[Trigger] = None

test("streaming - sink progress is produced") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied from KafkaSinkStreamingSuite as it's only relevant to micro-batch.


override protected def defaultTrigger: Option[Trigger] = Some(Trigger.Continuous(1000))

test("generic - write big data with small producer buffer") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied from KafkaContinuousSinkSuite. I guess it's not necessarily needed to be put here, but would like to leave it as it was.

override val streamingTimeout = 30.seconds
protected val streamingTimeout = 30.seconds

// TODO: this is set to "Int" since ContinuousMemoryStream cannot deal with String
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I might file another issue soon for fixing ContinuousMemoryStream to support String. There seems to some hurdles to fix that, so I just defer to the another issue. Please let me know if we want to fix it altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SPARK-29642 (#26300)

When #26300 is merged, I'll apply TODO describing here and remove TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SPARK-29642 is resolved - I'm making the change.

@SparkQA
Copy link

SparkQA commented Oct 29, 2019

Test build #112838 has finished for PR 26292 at commit 5e57bb5.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HeartSaVioR
Copy link
Contributor Author

Hmm... weird error on the build. I'll post to the dev mailing list if it fails again.

@HeartSaVioR
Copy link
Contributor Author

retest this, please

@SparkQA
Copy link

SparkQA commented Oct 29, 2019

Test build #112839 has finished for PR 26292 at commit 5e57bb5.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gaborgsomogyi
Copy link
Contributor

Yeah, weird issue. I'm going to file a PR soon and will take a look whether this comes there as well...

@HeartSaVioR
Copy link
Contributor Author

retest this, please

@SparkQA
Copy link

SparkQA commented Oct 29, 2019

Test build #112853 has finished for PR 26292 at commit 5e57bb5.

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

@HeartSaVioR
Copy link
Contributor Author

cc. @tdas @zsxwing @jose-torres @gaborgsomogyi
also cc. to @vanzin - this is follow-up work for #26158

@SparkQA
Copy link

SparkQA commented Oct 30, 2019

Test build #112869 has finished for PR 26292 at commit c019e5e.

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

*/
def assertExceptionLowercaseMsg(exception: Throwable, msg: String): Unit = {
assertExceptionMsgInternal(exception, msg) { case (exMsg, m) =>
exMsg.toLowerCase(Locale.ROOT).contains(m)
Copy link
Contributor

Choose a reason for hiding this comment

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

A boolean argument saying whether you want case-insensitive matching would be cleaner.

Or maybe you don't even need the argument, and just make the existing method case-insensitive... (just call toLowerCase on the expected message too)

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 also agree it wouldn't matter if we change existing one to case-insensitive. Will apply.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking some of the callers, there're some checks on class name or so which is still good to have case-sensitive matching. I'll add the parameter.

@SparkQA
Copy link

SparkQA commented Nov 6, 2019

Test build #113292 has finished for PR 26292 at commit 55860d6.

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

def assertExceptionMsg(exception: Throwable, msg: String): Unit = {
def assertExceptionMsg(exception: Throwable, msg: String, ignoreCase: Boolean = false): Unit = {
def contain(msg1: String, msg2: String): Boolean = {
if (ignoreCase) msg1.toLowerCase(Locale.ROOT).contains(msg2.toLowerCase(Locale.ROOT))
Copy link
Contributor

Choose a reason for hiding this comment

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

Use braces in multi-line conditions.

@HeartSaVioR
Copy link
Contributor Author

The last commit applies the change of SPARK-29642 to simplify the code.

@SparkQA
Copy link

SparkQA commented Nov 6, 2019

Test build #113342 has finished for PR 26292 at commit e4e36ed.

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

@vanzin
Copy link
Contributor

vanzin commented Nov 7, 2019

Merging to master.

@vanzin vanzin closed this in 252ecd3 Nov 7, 2019
@HeartSaVioR
Copy link
Contributor Author

Thanks for reviewing and merging!

@HeartSaVioR HeartSaVioR deleted the SPARK-29635 branch November 7, 2019 03:08
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