Skip to content

Conversation

@sander-goos
Copy link
Contributor

What changes were proposed in this pull request?

This PR introduces a helper method withExecutor that handles the creation of an Executor object and ensures that it is always stopped in a finally block. The tests in ExecutorSuite have been refactored to use this method.

Why are the changes needed?

Recently an issue was discovered that leaked Executors (which are not explicitly stopped after a test) can cause other tests to fail due to the JVM being killed after 10 min. It is therefore crucial that tests always stop the Executor. By introducing this helper method, a simple pattern is established that can be easily adopted in new tests, which reduces the risk of regressions.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Run the ExecutorSuite locally.

…ng sure they are always stopped after the test.
@sander-goos sander-goos changed the title [SPARK-33793][TESTS] Refactor usage of Executors to establish a pattern maki… [SPARK-33793][TESTS] Introduce withExecutor to ensure proper cleanup in tests Dec 15, 2020
@github-actions github-actions bot added the CORE label Dec 15, 2020
@HyukjinKwon
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Test build #132852 has started for PR 30783 at commit 87faa5a.

HyukjinKwon pushed a commit that referenced this pull request Dec 16, 2020
…in tests

### What changes were proposed in this pull request?
This PR introduces a helper method `withExecutor` that handles the creation of an Executor object and ensures that it is always stopped in a finally block. The tests in ExecutorSuite have been refactored to use this method.

### Why are the changes needed?
Recently an issue was discovered that leaked Executors (which are not explicitly stopped after a test) can cause other tests to fail due to the JVM being killed after 10 min. It is therefore crucial that tests always stop the Executor. By introducing this helper method, a simple pattern is established that can be easily adopted in new tests, which reduces the risk of regressions.

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

### How was this patch tested?
Run the ExecutorSuite locally.

Closes #30783 from sander-goos/SPARK-33793-close-executors.

Authored-by: Sander Goos <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
(cherry picked from commit ddff94f)
Signed-off-by: HyukjinKwon <[email protected]>
@HyukjinKwon
Copy link
Member

Merged to master and branch-3.1.

@sander-goos, it has a minor conflict against branch-3.0. Would you mind if I ask to open a backporting PR to branch-3.0?

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37454/

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/37454/

@sander-goos
Copy link
Contributor Author

Merged to master and branch-3.1.

@sander-goos, it has a minor conflict against branch-3.0. Would you mind if I ask to open a backporting PR to branch-3.0?

Thanks for merging. Sure, here is the backport: #30801

HyukjinKwon pushed a commit that referenced this pull request Dec 16, 2020
…anup in tests

Backport of: #30783

### What changes were proposed in this pull request?
This PR introduces a helper method `withExecutor` that handles the creation of an Executor object and ensures that it is always stopped in a finally block. The tests in ExecutorSuite have been refactored to use this method.

### Why are the changes needed?
Recently an issue was discovered that leaked Executors (which are not explicitly stopped after a test) can cause other tests to fail due to the JVM being killed after 10 min. It is therefore crucial that tests always stop the Executor. By introducing this helper method, a simple pattern is established that can be easily adopted in new tests, which reduces the risk of regressions.

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

### How was this patch tested?
Run the ExecutorSuite locally.

Closes #30801 from sander-goos/SPARK-33793-close-executors-3.0.

Authored-by: Sander Goos <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants