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-40467][SS] Split FlatMapGroupsWithState down to multiple test suites #37907

Closed
wants to merge 2 commits into from

Conversation

HeartSaVioR
Copy link
Contributor

What changes were proposed in this pull request?

This PR proposes to split the FlatMapGroupsWithStateSuite into three pieces:

  1. GroupStateSuite <- test the functionality with (Test)GroupState implementation
  2. FlatMapGroupsWithStateWithInitialStateSuite <- test E2E cases which are specific to initial state
  3. FlatMapGroupsWithStateSuite <- all other cases (E2E cases which don't leverage initial state)

The change is pure extraction - it's cut and paste and no additional code change has been introduced.

Why are the changes needed?

This would help to maintain the test suite FlatMapGroupsWithStateSuite as it's quite huge.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Refactored test suites.

@@ -78,416 +78,6 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest {
}
}

test("SPARK-35800: ensure TestGroupState creates instances the same as prod") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lines in L81 to L490 are moved out to GroupStateSuite.

@@ -1268,258 +858,6 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest {
assert(e.getMessage === "The output mode of function should be append or update")
}

import testImplicits._
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lines in L1271 to L1635 (except a single testcase which isn't related) are moved out to FlatMapGroupsWithStateWithInitialStateSuite. L1790 to L1809 are also moved out as they are only referred by L1271 to L1635.

)
}

def testWithAllStateVersions(name: String)(func: => Unit): Unit = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only one duplication we will have after refactoring. I just copied over the code rather than dealing with inheritance / util class as it's just about less than 10 lines.

@HeartSaVioR
Copy link
Contributor Author

Thanks! Merging to master. (The last commit only removed unused imports.)

LuciferYang pushed a commit to LuciferYang/spark that referenced this pull request Sep 20, 2022
…suites

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

This PR proposes to split the FlatMapGroupsWithStateSuite into three pieces:

1. GroupStateSuite <- test the functionality with (Test)GroupState implementation
2. FlatMapGroupsWithStateWithInitialStateSuite <- test E2E cases which are specific to initial state
3. FlatMapGroupsWithStateSuite <- all other cases (E2E cases which don't leverage initial state)

The change is pure extraction - it's cut and paste and no additional code change has been introduced.

### Why are the changes needed?

This would help to maintain the test suite FlatMapGroupsWithStateSuite as it's quite huge.

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

No.

### How was this patch tested?

Refactored test suites.

Closes apache#37907 from HeartSaVioR/SPARK-40467.

Authored-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
Signed-off-by: Jungtaek Lim <kabhwan.opensource@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants