dongjoon-hyun opened a new pull request, #60094:
URL: https://github.com/apache/spark/pull/60094
### What changes were proposed in this pull request?
This PR aims to fix the `graphx` test compilation in `branch-4.0` by
replacing `gridTest` with `Seq.foreach` in `LabelPropagationSuite`.
The SPARK-60835 backport to `branch-4.0` (1ff8a134385, #60050) kept master's
`gridTest` call.
```scala
gridTest("Label propagation breaks label ties with the lowest vertex ID")(
Seq((1L, 2L), (-2L, -1L), (Long.MinValue, Long.MaxValue))) { case (label1,
label2) =>
```
However, `SparkFunSuite.gridTest` was added by SPARK-52405 (#51098) in
Apache Spark 4.1.0, so `branch-4.0` doesn't have it. This PR uses the
`Seq.foreach` pattern of the other `branch-4.0` test suites like
`RecoverySuite`. The test names are identical to the ones that `gridTest`
generates.
```scala
Seq((1L, 2L), (-2L, -1L), (Long.MinValue, Long.MaxValue)).foreach {
case param @ (label1, label2) =>
test(s"Label propagation breaks label ties with the lowest vertex ID
($param)") {
```
### Why are the changes needed?
To fix the compilation failure of the `graphx` test code in `branch-4.0`.
The `Precompile Spark` job and the module test jobs fail at the `graphx` test
compilation.
- https://github.com/apache/spark/actions/runs/41746258326
```
[error]
.../graphx/src/test/scala/org/apache/spark/graphx/lib/LabelPropagationSuite.scala:45:3:
not found: value gridTest
[error] gridTest("Label propagation breaks label ties with the lowest
vertex ID")(
[error] ^
[error]
.../graphx/src/test/scala/org/apache/spark/graphx/lib/LabelPropagationSuite.scala:48:32:
type mismatch;
[error] found : Any
[error] required: org.apache.spark.graphx.VertexId
[error] (which expands to) Long
...
[error] three errors found
[error] (graphx / Test / compileIncremental) Compilation failed
```
### Does this PR introduce _any_ user-facing change?
No, this is a test-only change.
### How was this patch tested?
Pass the CIs. I also ran the following manually on `branch-4.0` with JDK 17.
```
$ build/sbt 'graphx/testOnly
org.apache.spark.graphx.lib.LabelPropagationSuite' 'graphx/scalastyle'
'graphx/Test/scalastyle'
...
[info] - Label Propagation (1 second, 959 milliseconds)
[info] - Label propagation breaks label ties with the lowest vertex ID
((1,2)) (119 milliseconds)
[info] - Label propagation breaks label ties with the lowest vertex ID
((-2,-1)) (99 milliseconds)
[info] - Label propagation breaks label ties with the lowest vertex ID
((-9223372036854775808,9223372036854775807)) (118 milliseconds)
[info] - Label propagation chooses the most frequent label before breaking
ties (96 milliseconds)
[info] Tests: succeeded 5, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
...
[info] scalastyle Found 0 errors
...
[info] scalastyle Found 0 errors
```
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]