New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release #422
Conversation
import org.apache.maven.surefire.common.junit3.JUnit3Reflector; | ||
import org.apache.maven.surefire.api.report.ReportEntry; | ||
import org.apache.maven.surefire.api.report.RunListener; | ||
import org.apache.maven.surefire.api.report.RunMode; | ||
import org.apache.maven.surefire.api.report.TestSetReportEntry; | ||
import org.apache.maven.surefire.shared.lang3.JavaVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In test classes we can use direct comons - not shaded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slawekjaranowski
It has certain purpose.
fail(); | ||
} | ||
|
||
Object sm = invokeGetter( System.class, null, "getSecurityManager" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.getSecurityManager() is public ... why by reflections
public static boolean isSecurityManagerSupported() | ||
{ | ||
ClassLoader classLoader = ObjectUtils.class.getClassLoader(); | ||
Class<?> smClass = tryLoadClass( classLoader, "java.lang.SecurityManager" ); | ||
return smClass != null && !smClass.isAnnotationPresent( Deprecated.class ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is checking java version >= 17 not enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was my previous solution but the class appears in module surefire-booter. This is surefire-api, so we cannot inherit it and cannot duplicate the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about Java Version from commons lang3 is is accessible by org.apache.maven.surefire.shared.lang3.JavaVersion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slawekjaranowski
Now JavaVersion is in use!
.github/workflows/maven-verify.yml
Outdated
timeout-minutes: 120 | ||
steps: | ||
- name: Verify | ||
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is shared workflow ... can not be uses as step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can extend this workflow with artifacts upload support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slawekjaranowski
This change does not exit in this branch any longer.
This CI script will publish archived artifacts for further analysis. We need to find out why the JVM exists after one hour of execution. |
.github/workflows/maven-verify.yml
Outdated
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
java: [8, 11, 17] | ||
jdk: [temurin] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 120 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v2.4.0 | ||
with: | ||
distribution: ${{ matrix.jdk }} | ||
java-version: ${{ matrix.java }} | ||
cache: 'maven' | ||
|
||
- name: Build with Maven | ||
run: mvn clean install -e -B -V -nsu --no-transfer-progress -P run-its -Dfailsafe-integration-test-port=8083 | ||
|
||
- name: Upload artifact surefire-its | ||
uses: actions/upload-artifact@v2-preview | ||
if: failure() | ||
with: | ||
name: ${{ matrix.os }}-surefire-its | ||
path: | | ||
surefire-its/target/*/log.txt | ||
surefire-its/target/**/surefire-reports/* | ||
surefire-its/target/**/failsafe-reports/* | ||
!surefire-its/target/failsafe-reports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do it in this way
it is step backward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message is investigating
. The commit does not mean anything for this Jira issue. We are discussing the timeout in the Slack/INFRA channel and I need to get the archive of surefire-its/target
with all the dump files and logs. This was happening one year ago and I came over this problem by splitting the test set in two. Currently I am waiting for the build to complete and I hope the archive files would appear in the attachment. Then I want to go inside and analyse the logs and test content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slawekjaranowski
The build runs every configuration twice, means push
and pull_request
. This is the waste and I also could not avoid it in my scripts. Do you know how to do it? This would save the h/w resources in favor of others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is because we have two events:
- push to branches
- pull_request
I try to discover how prevent it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the way attached artifacts has size > 1GB ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slawekjaranowski
This change does not exit in this branch any longer.
This investigation has helped me. It looks like the GH build runs out of disk space. It looks like one build crashed but the other did not. |
@slawekjaranowski |
089f18f
to
3cfc32d
Compare
1dead69
to
7aea773
Compare
…e removed in a future release
7aea773
to
0953f57
Compare
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
SUREFIRE-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean install
to 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.