Skip to content

[SPARK-47196][CORE][BUILD][3.4] Fix core module to succeed SBT tests#45295

Closed
dongjoon-hyun wants to merge 1 commit intoapache:branch-3.4from
dongjoon-hyun:SPARK-47196
Closed

[SPARK-47196][CORE][BUILD][3.4] Fix core module to succeed SBT tests#45295
dongjoon-hyun wants to merge 1 commit intoapache:branch-3.4from
dongjoon-hyun:SPARK-47196

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Feb 27, 2024

What changes were proposed in this pull request?

This PR aims to fix core module to succeed SBT tests by preserving mockito-core's byte-buddy test dependency.

Currently, Maven respects mockito-core's byte-buddy dependency while SBT doesn't.
MAVEN

$ build/mvn dependency:tree -pl core | grep byte-buddy
...
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.12.10:test
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.10:test

SBT

$ build/sbt "core/test:dependencyTree" | grep byte-buddy
...
[info]   | | | | +-net.bytebuddy:byte-buddy:1.12.10 (evicted by: 1.12.18)
[info]   | | | | +-net.bytebuddy:byte-buddy:1.12.18
...

Note that this happens at branch-3.4 from Apache Spark 3.4.0~3.4.2 only. branch-3.3/branch-3.5/master are okay.

Why are the changes needed?

BEFORE

$ build/sbt "core/testOnly *.DAGSchedulerSuite"
[info] DAGSchedulerSuite:
[info] - [SPARK-3353] parent stage should have lower stage id *** FAILED *** (439 milliseconds)
[info]   java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
...
[info] *** 1 SUITE ABORTED ***
[info] *** 118 TESTS FAILED ***
[error] Error during tests:
[error] 	org.apache.spark.scheduler.DAGSchedulerSuite
[error] (core / Test / testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 48 s, completed Feb 27, 2024, 1:26:27 PM

AFTER

$ build/sbt "core/testOnly *.DAGSchedulerSuite"
...
[info] All tests passed.
[success] Total time: 22 s, completed Feb 27, 2024, 1:24:34 PM

Does this PR introduce any user-facing change?

No, this is a test-only fix.

How was this patch tested?

Pass the CIs and manual tests.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the BUILD label Feb 27, 2024
@dongjoon-hyun
Copy link
Member Author

Could you review this PR, @huaxingao ?

@huaxingao
Copy link
Contributor

LGTM. Thanks for the fix.

@dongjoon-hyun
Copy link
Member Author

Thank you, @huaxingao !

dongjoon-hyun added a commit that referenced this pull request Feb 28, 2024
### What changes were proposed in this pull request?

This PR aims to fix `core` module to succeed SBT tests by preserving `mockito-core`'s `byte-buddy` test dependency.

Currently, `Maven` respects `mockito-core`'s byte-buddy dependency while SBT doesn't.
**MAVEN**
```
$ build/mvn dependency:tree -pl core | grep byte-buddy
...
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.12.10:test
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.10:test
```

**SBT**
```
$ build/sbt "core/test:dependencyTree" | grep byte-buddy
...
[info]   | | | | +-net.bytebuddy:byte-buddy:1.12.10 (evicted by: 1.12.18)
[info]   | | | | +-net.bytebuddy:byte-buddy:1.12.18
...
```

Note that this happens at `branch-3.4` from Apache Spark 3.4.0~3.4.2 only. branch-3.3/branch-3.5/master are okay.

### Why are the changes needed?

**BEFORE**
```
$ build/sbt "core/testOnly *.DAGSchedulerSuite"
[info] DAGSchedulerSuite:
[info] - [SPARK-3353] parent stage should have lower stage id *** FAILED *** (439 milliseconds)
[info]   java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
...
[info] *** 1 SUITE ABORTED ***
[info] *** 118 TESTS FAILED ***
[error] Error during tests:
[error] 	org.apache.spark.scheduler.DAGSchedulerSuite
[error] (core / Test / testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 48 s, completed Feb 27, 2024, 1:26:27 PM
```

**AFTER**
```
$ build/sbt "core/testOnly *.DAGSchedulerSuite"
...
[info] All tests passed.
[success] Total time: 22 s, completed Feb 27, 2024, 1:24:34 PM
```

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

No, this is a test-only fix.

### How was this patch tested?

Pass the CIs and manual tests.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #45295 from dongjoon-hyun/SPARK-47196.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
@dongjoon-hyun
Copy link
Member Author

Thank you, @HyukjinKwon .
Merged to branch-3.4.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-47196 branch February 28, 2024 02:23
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Mar 26, 2024
### What changes were proposed in this pull request?

This PR aims to fix `core` module to succeed SBT tests by preserving `mockito-core`'s `byte-buddy` test dependency.

Currently, `Maven` respects `mockito-core`'s byte-buddy dependency while SBT doesn't.
**MAVEN**
```
$ build/mvn dependency:tree -pl core | grep byte-buddy
...
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.12.10:test
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.12.10:test
```

**SBT**
```
$ build/sbt "core/test:dependencyTree" | grep byte-buddy
...
[info]   | | | | +-net.bytebuddy:byte-buddy:1.12.10 (evicted by: 1.12.18)
[info]   | | | | +-net.bytebuddy:byte-buddy:1.12.18
...
```

Note that this happens at `branch-3.4` from Apache Spark 3.4.0~3.4.2 only. branch-3.3/branch-3.5/master are okay.

### Why are the changes needed?

**BEFORE**
```
$ build/sbt "core/testOnly *.DAGSchedulerSuite"
[info] DAGSchedulerSuite:
[info] - [SPARK-3353] parent stage should have lower stage id *** FAILED *** (439 milliseconds)
[info]   java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
...
[info] *** 1 SUITE ABORTED ***
[info] *** 118 TESTS FAILED ***
[error] Error during tests:
[error] 	org.apache.spark.scheduler.DAGSchedulerSuite
[error] (core / Test / testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 48 s, completed Feb 27, 2024, 1:26:27 PM
```

**AFTER**
```
$ build/sbt "core/testOnly *.DAGSchedulerSuite"
...
[info] All tests passed.
[success] Total time: 22 s, completed Feb 27, 2024, 1:24:34 PM
```

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

No, this is a test-only fix.

### How was this patch tested?

Pass the CIs and manual tests.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#45295 from dongjoon-hyun/SPARK-47196.

Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
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

Comments