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][2.4] Fix flaky test suite DeltaSourceDeletionVectorsSuite #2001

Merged

Conversation

larsk-db
Copy link
Contributor

@larsk-db larsk-db commented Aug 25, 2023

Description

(Cherrypick of 67c4b98 to branch-2.4)

  • Remove flakiness from a previously flaky test case, by ensuring that the stream is stopped processing before running new DML commands on the source table.

Fixes #1982

How was this patch tested?

Testing-only PR.

Does this PR introduce any user-facing changes?

No.

new StreamManualClock(System.currentTimeMillis())),
AdvanceManualClock(10L * 1000L),
StartStream(Trigger.ProcessingTime(1000), clock),
AdvanceManualClock(1000L),
Copy link
Contributor

Choose a reason for hiding this comment

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

this part is basically no different from before .. isnt it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, just got rid of some unnecessary large numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes it clearer imo that all the units match up as well.

Copy link
Contributor

@tdas tdas Aug 25, 2023

Choose a reason for hiding this comment

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

But the numbers themselves dont matter for the runtime since its manual clock.. isnt it? just making sure.

Making consistent is definitely great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the numbers are irrelevant. This purely a readability improvement.

CheckAnswer((0 until 15): _*),
AssertOnQuery { q =>
// Make sure we only processed a single batch since the initial data load.
Copy link
Contributor

Choose a reason for hiding this comment

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

Which check was flaky here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The stream hadn't always stopped processing before we executed the 2 DML commands. So they'd sometimes end up together in the same batch and sometimes in two different batches, because they were processing even before the second increase of the clock. The thing that finally fixed it was adding the waiting for the stream to settle down before even starting on the DML commands.

@vkorukanti vkorukanti merged commit 68608d7 into delta-io:branch-2.4 Sep 7, 2023
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants