Replace runing external process and parsing output with simple ProcessHandle if available (Java9+)#3252
Conversation
|
tentative option for #3176 |
surefire-booter/src/main/java/org/apache/maven/surefire/booter/ParentProcessCheckerFactory.java
Outdated
Show resolved
Hide resolved
surefire-booter/src/test/java/org/apache/maven/surefire/booter/ProcessHandleCheckerTest.java
Show resolved
Hide resolved
66b9a60 to
15a377e
Compare
surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java
Outdated
Show resolved
Hide resolved
surefire-booter/src/test/java/org/apache/maven/surefire/booter/ProcessCheckerFactoryTest.java
Outdated
Show resolved
Hide resolved
4a2eb85 to
57029db
Compare
.github/workflows/maven-verify.yml
Outdated
| timeout-minutes: 600 | ||
| os-matrix: '[ "ubuntu-latest", "windows-2022", "macos-latest" ]' | ||
| os-matrix: '[ "ubuntu-latest", "windows-2022", "windows-latest", "macos-latest" ]' | ||
| # exclude jkd 8 on windows-latest wmc process not here anymore and jdk8 not supporting processhandle |
There was a problem hiding this comment.
does mean that surefire will not works on JDK8 at windows?
There was a problem hiding this comment.
that's already the case (not for gh node windows-latest with Java 8) see #3176
and not much we can do except using some other external tool such as proposed here #3176 (comment) but I find too complicated as it will be needed only for Java8
There was a problem hiding this comment.
So when this breaks execution of surefire on JDK 8, this is a PR for 4.x.x (and Java 17)?
There was a problem hiding this comment.
So when this breaks execution of surefire on JDK 8, this is a PR for 4.x.x (and Java 17)?
nope. still working on jdk8 for windows-2022, linux or osx.
exclusion is ONLY windows-latest and jdk8. but now will work on windows-latest for modern jdk (9+ as it's not working now)
It's only broken now for jdk8 on windows-latest but will be find for jdk9+ please read linked issue and the comment added in maven-verify.yml
Sorry I don't really want to spend time to fix for windows-latest and jdk8
There was a problem hiding this comment.
Please update to:
os-matrix: '[ "ubuntu-latest", "windows-latest", "macos-latest" ]'
matrix-exclude: >
[
{"jdk": "8", "os": "windows-latest"}
]
matrix-include: >
[
{"jdk": "8", "os": "windows-2022", "distribution": "zulu", "maven": "3.9.12"}
]we will have execution - windows-latest for all jdk expect jdk8 and windows-2022 only for jdk8
There was a problem hiding this comment.
if you add windows-2022 and windows-latest to global matrix with one exclude, we will have executed
windows-2022 - jdk8, jdk11, jdk17, jdk21
windows-latest - jdk11, jdk17, jdk21
so will be a 7 builds for windows
with my proposition we will have:
windows-2022 - jdk8
windows-latest - jdk11, jdk17, jdk21
4 builds
I'm not sure if we need such many windows builds
There was a problem hiding this comment.
Ah right, good point.
Maybe another build on windows-2022 with a more recent JDK?
There was a problem hiding this comment.
Maybe another build on windows-2022 with a more recent JDK?
JDK21 🤔
There was a problem hiding this comment.
if #3258 is accepted, there is no need to do any change in the matrix
57029db to
1e3a1ca
Compare
|
It does not make sense to support Java 8 and Java 9. We should switch to Java 9 only. |
|
I have a strong reason to forget java 8 in Surefire because the PPID Checker needs to use java 9. |
This sould be discused on mailing list - to drop Java 8 support |
bmarwell
left a comment
There was a problem hiding this comment.
+1, because JDK9+ on latest windows will start working again, so it's better than doing nothing.
surefire-booter/src/test/java/org/apache/maven/surefire/booter/ProcessCheckerTest.java
Outdated
Show resolved
Hide resolved
surefire-booter/src/test/java/org/apache/maven/surefire/booter/ProcessCheckerTest.java
Outdated
Show resolved
Hide resolved
surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessChecker.java
Show resolved
Hide resolved
surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java
Outdated
Show resolved
Hide resolved
surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessChecker.java
Outdated
Show resolved
Hide resolved
surefire-booter/src/main/java/org/apache/maven/surefire/booter/ProcessHandleChecker.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
…rue with Java9+ and ProcessHandle Signed-off-by: Olivier Lamy <olamy@apache.org>
e2126a3 to
a280d15
Compare
Signed-off-by: Olivier Lamy <olamy@apache.org>
|
The last thing seems to be an update of https://github.com/apache/maven-surefire/blob/master/maven-surefire-plugin/src/site/apt/examples/shutdown.apt.vm#L58-L61 I should have updated it with wmic->powershell change in #3258 but it needs more info after this PR anyway. |
Signed-off-by: Olivier Lamy <olamy@apache.org>
Good catch. I have updated the page. Not with too many details, as this will be gone rather sooner than later. |
|
@olamy @slachiewicz I will have a look into these changes. But I agree to discuss it on the mailing list. Of course, there's a compromise. There are several notices on my side:
|
Signed-off-by: Olivier Lamy olamy@apache.org
Following this checklist to help us incorporate your
contribution quickly and easily:
mvn clean installto make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean install).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.