-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[SPARK-49842][BUILD] Add byte-buddy
dependency for modules that depend on mockito-core
to ensure sbt test
uses the correct byte-buddy
with Java 21
#48281
Closed
Closed
Conversation
This file contains 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
github-actions
bot
added
SQL
MLLIB
STRUCTURED STREAMING
SPARK SHELL
YARN
DSTREAM
CONNECT
labels
Sep 27, 2024
LuciferYang
changed the title
[WIP] Test the correct loading of
[WIP][BUILD] Test the correct loading of Sep 27, 2024
byte-buddy
byte-buddy
LuciferYang
changed the title
[WIP][BUILD] Test the correct loading of
[SPARK-49842][BUILD] Test the correct loading of Oct 1, 2024
byte-buddy
byte-buddy
LuciferYang
changed the title
[SPARK-49842][BUILD] Test the correct loading of
[SPARK-49842][BUILD] Add Oct 1, 2024
byte-buddy
byte-buddy
dependency for modules that depend on mockito-core
to ensure sbt test
uses the correct byte-buddy
with Java 21
HyukjinKwon
approved these changes
Oct 4, 2024
Merged into master for Spark 4.0. Thanks @HyukjinKwon |
himadripal
pushed a commit
to himadripal/spark
that referenced
this pull request
Oct 19, 2024
…end on `mockito-core` to ensure `sbt test` uses the correct `byte-buddy` with Java 21 ### What changes were proposed in this pull request? This pr add `byte-buddy` dependency for modules that depend on `mockito-core` to ensure `sbt test` uses the correct `byte-buddy` ### Why are the changes needed? To ensure that `sbt test` can use the correct version of `byte-buddy`, I have only observed this issue when using `sbt test` with Java 21. This issue has not been observed when using `sbt test` with Java 17(Perhaps it just didn't print the Warning Message) or `maven test` with Java 17/21(Maven can confirm that there is no such issue). Java 21 sbt daily test: - https://github.com/apache/spark/actions/runs/11099131939/job/30881044324 ``` WARNING: A Java agent has been loaded dynamically (/home/runner/.cache/coursier/v1/https/maven-central.storage-download.googleapis.com/maven2/net/bytebuddy/byte-buddy-agent/1.14.15/byte-buddy-agent-1.14.15.jar) ``` - https://github.com/apache/spark/actions/runs/11099131939/job/30881045891 ``` WARNING: A Java agent has been loaded dynamically (/home/runner/.cache/coursier/v1/https/maven-central.storage-download.googleapis.com/maven2/net/bytebuddy/byte-buddy-agent/1.14.15/byte-buddy-agent-1.14.15.jar) ``` - https://github.com/apache/spark/actions/runs/11099131939/job/30881047740 ``` WARNING: A Java agent has been loaded dynamically (/home/runner/.cache/coursier/v1/https/maven-central.storage-download.googleapis.com/maven2/net/bytebuddy/byte-buddy-agent/1.14.15/byte-buddy-agent-1.14.15.jar) ``` We can see that `byte-buddy-agent-1.14.15.jar` is being used in the sbt tests with Java 21, but the version defined in the `dependencyManagement` of the parent `pom.xml` is `1.14.17`: https://github.com/apache/spark/blob/3093ad68d2a3c6bab9c1605381d27e700766be22/pom.xml#L1221-L1231 Inconsistent dependency versions pose potential risks, such as the possibility that maven tests may pass while sbt tests may fail. Therefore, we should correct it.Meanwhile, for consistency, I have added a test dependency on `byte-buddy` for all modules that depend on `mockito-core`. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - Pass GitHub Actions - Manual inspection shows that `sbt test` with Java 21 is using version 1.14.17 of `byte-buddy-agent` - https://github.com/LuciferYang/spark/actions/runs/11072600528/job/30922654197 - https://github.com/LuciferYang/spark/actions/runs/11072600528/job/30922654969 - https://github.com/LuciferYang/spark/actions/runs/11072600528/job/30922655852 - https://github.com/LuciferYang/spark/actions/runs/11072600528/job/30922656840 ``` WARNING: A Java agent has been loaded dynamically (/home/runner/.cache/coursier/v1/https/maven-central.storage-download.googleapis.com/maven2/net/bytebuddy/byte-buddy-agent/1.14.17/byte-buddy-agent-1.14.17.jar) ``` ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#48281 from LuciferYang/byte-buddy. Lead-authored-by: yangjie01 <yangjie01@baidu.com> Co-authored-by: YangJie <yangjie01@baidu.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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?
This pr add
byte-buddy
dependency for modules that depend onmockito-core
to ensuresbt test
uses the correctbyte-buddy
Why are the changes needed?
To ensure that
sbt test
can use the correct version ofbyte-buddy
, I have only observed this issue when usingsbt test
with Java 21. This issue has not been observed when usingsbt test
with Java 17(Perhaps it just didn't print the Warning Message) ormaven test
with Java 17/21(Maven can confirm that there is no such issue).Java 21 sbt daily test:
We can see that
byte-buddy-agent-1.14.15.jar
is being used in the sbt tests with Java 21, but the version defined in thedependencyManagement
of the parentpom.xml
is1.14.17
:spark/pom.xml
Lines 1221 to 1231 in 3093ad6
Inconsistent dependency versions pose potential risks, such as the possibility that maven tests may pass while sbt tests may fail. Therefore, we should correct it.Meanwhile, for consistency, I have added a test dependency on
byte-buddy
for all modules that depend onmockito-core
.Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass GitHub Actions
Manual inspection shows that
sbt test
with Java 21 is using version 1.14.17 ofbyte-buddy-agent
Was this patch authored or co-authored using generative AI tooling?
No