Skip to content

Commit 182353d

Browse files
WweiLhvanhovell
authored andcommitted
[SPARK-49523][CONNECT] Increase maximum wait time for connect server to come up for testing
### What changes were proposed in this pull request? This PR increases the max time we wait for a connect server to come up for testing. The current threshold is too low, and is causing flakyness. ### Why are the changes needed? It makes connect tests less flaky. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? It is test infra code. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47994 from WweiL/deflake-will-it-work. Authored-by: Wei Liu <[email protected]> Signed-off-by: Herman van Hovell <[email protected]>
1 parent 9a7b6e5 commit 182353d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/test/RemoteSparkSession.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import java.util.concurrent.TimeUnit
2424
import scala.concurrent.duration.FiniteDuration
2525

2626
import org.scalatest.{BeforeAndAfterAll, Suite}
27+
import org.scalatest.concurrent.Eventually.eventually
28+
import org.scalatest.concurrent.Futures.timeout
29+
import org.scalatest.time.SpanSugar._
2730

2831
import org.apache.spark.SparkBuildInfo
2932
import org.apache.spark.sql.SparkSession
@@ -184,12 +187,14 @@ object SparkConnectServerUtils {
184187
.port(port)
185188
.retryPolicy(RetryPolicy
186189
.defaultPolicy()
187-
.copy(maxRetries = Some(7), maxBackoff = Some(FiniteDuration(10, "s"))))
190+
.copy(maxRetries = Some(10), maxBackoff = Some(FiniteDuration(30, "s"))))
188191
.build())
189192
.create()
190193

191194
// Execute an RPC which will get retried until the server is up.
192-
assert(spark.version == SparkBuildInfo.spark_version)
195+
eventually(timeout(1.minute)) {
196+
assert(spark.version == SparkBuildInfo.spark_version)
197+
}
193198

194199
// Auto-sync dependencies.
195200
SparkConnectServerUtils.syncTestDependencies(spark)

0 commit comments

Comments
 (0)