[SPARK-57482][CORE][TESTS] Fix flaky SparkLauncherSuite.testInProcessLauncher under CI load#56529
Closed
dbtsai wants to merge 1 commit into
Closed
[SPARK-57482][CORE][TESTS] Fix flaky SparkLauncherSuite.testInProcessLauncher under CI load#56529dbtsai wants to merge 1 commit into
dbtsai wants to merge 1 commit into
Conversation
…Launcher under CI load
### What changes were proposed in this pull request?
`SparkLauncherSuite.testInProcessLauncher` waits for the connection between
the in-process app and the launcher to be established by polling the app
handle state with `eventually(Duration.ofSeconds(5), Duration.ofMillis(10))`.
Under heavy CI load this 5-second window is too short: the handle can remain
in `UNKNOWN` for longer, causing the test to fail with:
```
java.lang.IllegalStateException: Failed check after 476 tries:
expected: not equal but was: <UNKNOWN>.
at org.apache.spark.launcher.BaseSuite.eventually(BaseSuite.java:88)
at org.apache.spark.launcher.SparkLauncherSuite.inProcessLauncherTestImpl(...)
```
This change increases the timeout to 30 seconds with a 100ms poll interval,
consistent with `waitForSparkContextShutdown` (30s/100ms) and the other
`eventually` calls in this suite (60s/1000ms).
### Why are the changes needed?
`SparkLauncherSuite.testInProcessLauncher` is flaky under CI load. The fix
only relaxes a test timeout; it does not change production behavior.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing test `SparkLauncherSuite.testInProcessLauncher`.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8
Co-authored-by: Isaac
dbtsai
added a commit
that referenced
this pull request
Jun 16, 2026
…auncher under CI load ### What changes were proposed in this pull request? `SparkLauncherSuite.testInProcessLauncher` waits for the connection between the in-process app and the launcher to be established by polling the app handle state with `eventually(Duration.ofSeconds(5), Duration.ofMillis(10))`. Under heavy CI load this 5-second window is too short: the handle can remain in `UNKNOWN` for longer, causing the test to fail with: ``` java.lang.IllegalStateException: Failed check after 476 tries: expected: not equal but was: <UNKNOWN>. at org.apache.spark.launcher.BaseSuite.eventually(BaseSuite.java:88) at org.apache.spark.launcher.SparkLauncherSuite.inProcessLauncherTestImpl(SparkLauncherSuite.java:162) at org.apache.spark.launcher.SparkLauncherSuite.testInProcessLauncher(SparkLauncherSuite.java:130) ``` This change increases the timeout to 30 seconds with a 100ms poll interval, consistent with `waitForSparkContextShutdown` (30s/100ms) and the other `eventually` calls in this suite (60s/1000ms). ### Why are the changes needed? `SparkLauncherSuite.testInProcessLauncher` is flaky under CI load. The change only relaxes a test timeout; it does not change production behavior. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test `SparkLauncherSuite.testInProcessLauncher`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 Closes #56529 from dbtsai/dbtsai/fix-flaky-inprocess-launcher. Authored-by: DB Tsai <dbtsai@dbtsai.com> Signed-off-by: DB Tsai <dbtsai@dbtsai.com> (cherry picked from commit 1cf08e6) Signed-off-by: DB Tsai <dbtsai@dbtsai.com>
dbtsai
added a commit
that referenced
this pull request
Jun 16, 2026
…auncher under CI load ### What changes were proposed in this pull request? `SparkLauncherSuite.testInProcessLauncher` waits for the connection between the in-process app and the launcher to be established by polling the app handle state with `eventually(Duration.ofSeconds(5), Duration.ofMillis(10))`. Under heavy CI load this 5-second window is too short: the handle can remain in `UNKNOWN` for longer, causing the test to fail with: ``` java.lang.IllegalStateException: Failed check after 476 tries: expected: not equal but was: <UNKNOWN>. at org.apache.spark.launcher.BaseSuite.eventually(BaseSuite.java:88) at org.apache.spark.launcher.SparkLauncherSuite.inProcessLauncherTestImpl(SparkLauncherSuite.java:162) at org.apache.spark.launcher.SparkLauncherSuite.testInProcessLauncher(SparkLauncherSuite.java:130) ``` This change increases the timeout to 30 seconds with a 100ms poll interval, consistent with `waitForSparkContextShutdown` (30s/100ms) and the other `eventually` calls in this suite (60s/1000ms). ### Why are the changes needed? `SparkLauncherSuite.testInProcessLauncher` is flaky under CI load. The change only relaxes a test timeout; it does not change production behavior. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test `SparkLauncherSuite.testInProcessLauncher`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 Closes #56529 from dbtsai/dbtsai/fix-flaky-inprocess-launcher. Authored-by: DB Tsai <dbtsai@dbtsai.com> Signed-off-by: DB Tsai <dbtsai@dbtsai.com> (cherry picked from commit 1cf08e6) Signed-off-by: DB Tsai <dbtsai@dbtsai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
SparkLauncherSuite.testInProcessLauncherwaits for the connection between the in-process app and the launcher to be established by polling the app handle state witheventually(Duration.ofSeconds(5), Duration.ofMillis(10)). Under heavy CI load this 5-second window is too short: the handle can remain inUNKNOWNfor longer, causing the test to fail with:This change increases the timeout to 30 seconds with a 100ms poll interval, consistent with
waitForSparkContextShutdown(30s/100ms) and the othereventuallycalls in this suite (60s/1000ms).Why are the changes needed?
SparkLauncherSuite.testInProcessLauncheris flaky under CI load. The change only relaxes a test timeout; it does not change production behavior.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing test
SparkLauncherSuite.testInProcessLauncher.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8