Bug#1053041: junit5-system-exit: FTBFS with default Java 21
Vladimir Petko
vpa1977 at gmail.com
Tue Sep 26 23:04:53 BST 2023
Source: junit5-system-exit
Version: 1.1.2-4
Severity: important
Tags: ftbfs
User: debian-java at lists.debian.org
Usertags: default-java21
X-Debbugs-Cc: vladimir.petko at canonical.com
Dear Maintainers,
The package junit5-system-exit ftbfs with default Java 21.
The relevant part of the build log:
---------------
java \
-jar /usr/share/java/junit-platform-console-standalone.jar \
-cp build/libs/junit5-system-exit.jar:build/libs/junit5-system-exit-tests.jar \
--scan-classpath \
--fail-if-no-tests
Thanks for using JUnit! Support its development at https://junit.org/sponsoring
[36m╷[0m
[36m├─[0m [36mJUnit Platform Suite[0m [32m✔[0m
[36m├─[0m [36mJUnit Jupiter[0m [32m✔[0m
[36m│ ├─[0m [36mWithParameterizedTest[0m [32m✔[0m
[36m│ │ └─[0m [31m at ParameterizedTest on method should reset state between tests[0m [31m✘[0m [31mTest 0 should have succeeded, but didn't[0m
[36m│ ├─[0m [36mExpectSystemExitWithStatusTest[0m [32m✔[0m
[36m│ │ ├─[0m [36mFailure Cases[0m [32m✔[0m
[36m│ │ │ ├─[0m [34mSystem.exit(1234) is expected but another code was used, on method[0m [32m✔[0m
[36m│ │ │ ├─[0m [34mSystem.exit(1234) is expected but not called at all, on method[0m [32m✔[0m
[36m│ │ │ ├─[0m [34mSystem.exit(1234) is expected but another code was used, on class[0m [32m✔[0m
[36m│ │ │ └─[0m [34mSystem.exit(1234) is expected but not called at all, on method[0m [32m✔[0m
[36m│ │ └─[0m [36mSuccess Cases[0m [32m✔[0m
[36m│ │ ├─[0m [31mSystem.exit(1234) is caught and detected[0m [31m✘[0m [31mThe Security Manager is deprecated and will be removed in a future release[0m
[36m│ │ ├─[0m [31mSystem.exit(1234) is caught and detected within a thread[0m [31m✘[0m [31mThe Security Manager is deprecated and will be removed in a future release[0m
[36m│ │ └─[0m [36mClass Success[0m [32m✔[0m
[36m│ │ └─[0m [31mMethod in class annotated with ExpectSystemExitWithStatus(123456) succeeds[0m [31m✘[0m [31mThe Security Manager is deprecated and will be removed in a future release[0m
[36m│ ├─[0m [36mExpectSystemExitTest[0m [32m✔[0m
[36m│ │ ├─[0m [36mFailure Cases[0m [32m✔[0m
[36m│ │ │ ├─[0m [34mSystem.exit() is expected for method but not called[0m [32m✔[0m
[36m│ │ │ └─[0m [34mSystem.exit() is expected for class but not called[0m [32m✔[0m
[36m│ │ └─[0m [36mSuccess Cases[0m [32m✔[0m
[36m│ │ ├─[0m [31mSystem.exit() is caught and detected[0m [31m✘[0m [31mThe Security Manager is deprecated and will be removed in a future release[0m
[36m│ │ ├─[0m [31mSystem.exit() is caught and detected within a thread[0m [31m✘[0m [31mThe Security Manager is deprecated and will be removed in a future release[0m
[36m│ │ └─[0m [36mClass Success[0m [32m✔[0m
[36m│ │ └─[0m [31mMethod in class annotated with ExpectSystemExit succeeds[0m [31m✘[0m [31mThe Security Manager is deprecated and will be removed in a future release[0m
[36m│ ├─[0m [36mFailOnSystemExitTest[0m [32m✔[0m
[36m│ │ ├─[0m [31m at FailOnSystemExit on class - System.exit not called[0m [31m✘[0m [31mSingle test should have succeeded ==> expected: <1> but was: <0>[0m
[36m│ │ ├─[0m [34m at FailOnSystemExit on class - exception caught and fails test[0m [32m✔[0m
[36m│ │ ├─[0m [34m at FailOnSystemExit on method - exception caught and fails test[0m [32m✔[0m
[36m│ │ └─[0m [31m at FailOnSystemExit on method - System.exit not called[0m [31m✘[0m [31mSingle test should have succeeded ==> expected: <1> but was: <0>[0m
[36m│ └─[0m [36mDisallowExitSecurityManagerTest[0m [32m✔[0m
[36m│ ├─[0m [34mCaptures first exit status code only[0m [32m✔[0m
[36m│ └─[0m [34mCounts number of exits prevented[0m [32m✔[0m
[36m└─[0m [36mJUnit Vintage[0m [32m✔[0m
Failures (9):
JUnit Jupiter:WithParameterizedTest:@ParameterizedTest on method should reset state between tests
MethodSource [className = 'com.ginsberg.junit.exit.WithParameterizedTest', methodName = 'failOnSystemExitOnClass', methodParameterTypes = '']
=> org.opentest4j.AssertionFailedError: Test 0 should have succeeded, but didn't
org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:38)
org.junit.jupiter.api.Assertions.fail(Assertions.java:135)
com.ginsberg.junit.exit.TestUtils.assertParameterizedTestFails(TestUtils.java:69)
com.ginsberg.junit.exit.WithParameterizedTest.failOnSystemExitOnClass(WithParameterizedTest.java:16)
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
java.base/java.lang.reflect.Method.invoke(Method.java:578)
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
[...]
JUnit Jupiter:ExpectSystemExitWithStatusTest:Success Cases:System.exit(1234) is caught and detected
MethodSource [className = 'com.ginsberg.junit.exit.ExpectSystemExitWithStatusTest$HappyPath', methodName = 'detectSystemExit', methodParameterTypes = '']
=> java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
java.base/java.lang.System.setSecurityManager(System.java:429)
com.ginsberg.junit.exit.SystemExitExtension.beforeEach(SystemExitExtension.java:95)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[...]
Suppressed: org.opentest4j.AssertionFailedError: Expected System.exit(1234) to be called, but it was not. ==> expected: <1234> but was: <null>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:587)
[...]
JUnit Jupiter:ExpectSystemExitWithStatusTest:Success Cases:System.exit(1234) is caught and detected within a thread
MethodSource [className = 'com.ginsberg.junit.exit.ExpectSystemExitWithStatusTest$HappyPath', methodName = 'detectSystemExitInThread', methodParameterTypes = '']
=> java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
java.base/java.lang.System.setSecurityManager(System.java:429)
com.ginsberg.junit.exit.SystemExitExtension.beforeEach(SystemExitExtension.java:95)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[...]
Suppressed: org.opentest4j.AssertionFailedError: Expected System.exit(1234) to be called, but it was not. ==> expected: <1234> but was: <null>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:587)
[...]
JUnit Jupiter:ExpectSystemExitWithStatusTest:Success Cases:Class Success:Method in class annotated with ExpectSystemExitWithStatus(123456) succeeds
MethodSource [className = 'com.ginsberg.junit.exit.ExpectSystemExitWithStatusTest$HappyPath$ExpectedSuccessClassLevel', methodName = 'classLevelExpect', methodParameterTypes = '']
=> java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
java.base/java.lang.System.setSecurityManager(System.java:429)
com.ginsberg.junit.exit.SystemExitExtension.beforeEach(SystemExitExtension.java:95)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[...]
Suppressed: org.opentest4j.AssertionFailedError: Expected System.exit(123456) to be called, but it was not. ==> expected: <123456> but was: <null>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:587)
[...]
JUnit Jupiter:ExpectSystemExitTest:Success Cases:System.exit() is caught and detected
MethodSource [className = 'com.ginsberg.junit.exit.ExpectSystemExitTest$HappyPath', methodName = 'detectSystemExit', methodParameterTypes = '']
=> java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
java.base/java.lang.System.setSecurityManager(System.java:429)
com.ginsberg.junit.exit.SystemExitExtension.beforeEach(SystemExitExtension.java:95)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[...]
Suppressed: org.opentest4j.AssertionFailedError: Expected System.exit() to be called, but it was not ==> expected: not <null>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:309)
[...]
JUnit Jupiter:ExpectSystemExitTest:Success Cases:System.exit() is caught and detected within a thread
MethodSource [className = 'com.ginsberg.junit.exit.ExpectSystemExitTest$HappyPath', methodName = 'detectSystemExitInThread', methodParameterTypes = '']
=> java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
java.base/java.lang.System.setSecurityManager(System.java:429)
com.ginsberg.junit.exit.SystemExitExtension.beforeEach(SystemExitExtension.java:95)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[...]
Suppressed: org.opentest4j.AssertionFailedError: Expected System.exit() to be called, but it was not ==> expected: not <null>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:309)
[...]
JUnit Jupiter:ExpectSystemExitTest:Success Cases:Class Success:Method in class annotated with ExpectSystemExit succeeds
MethodSource [className = 'com.ginsberg.junit.exit.ExpectSystemExitTest$HappyPath$ExpectedSuccessClassLevel', methodName = 'classLevelExpect', methodParameterTypes = '']
=> java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
java.base/java.lang.System.setSecurityManager(System.java:429)
com.ginsberg.junit.exit.SystemExitExtension.beforeEach(SystemExitExtension.java:95)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$2(TestMethodTestDescriptor.java:166)
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:202)
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
[...]
Suppressed: org.opentest4j.AssertionFailedError: Expected System.exit() to be called, but it was not ==> expected: not <null>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:309)
[...]
JUnit Jupiter:FailOnSystemExitTest:@FailOnSystemExit on class - System.exit not called
MethodSource [className = 'com.ginsberg.junit.exit.FailOnSystemExitTest', methodName = 'succeedWhenNotCallingSystemExitOnClass', methodParameterTypes = '']
=> org.opentest4j.AssertionFailedError: Single test should have succeeded ==> expected: <1> but was: <0>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:166)
org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:661)
com.ginsberg.junit.exit.TestUtils.assertTestSucceeds(TestUtils.java:88)
com.ginsberg.junit.exit.FailOnSystemExitTest.succeedWhenNotCallingSystemExitOnClass(FailOnSystemExitTest.java:57)
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
java.base/java.lang.reflect.Method.invoke(Method.java:578)
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
[...]
JUnit Jupiter:FailOnSystemExitTest:@FailOnSystemExit on method - System.exit not called
MethodSource [className = 'com.ginsberg.junit.exit.FailOnSystemExitTest', methodName = 'succeedWhenNotCallingSystemExitInMethod', methodParameterTypes = '']
=> org.opentest4j.AssertionFailedError: Single test should have succeeded ==> expected: <1> but was: <0>
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:166)
org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:661)
com.ginsberg.junit.exit.TestUtils.assertTestSucceeds(TestUtils.java:81)
com.ginsberg.junit.exit.FailOnSystemExitTest.succeedWhenNotCallingSystemExitInMethod(FailOnSystemExitTest.java:45)
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
java.base/java.lang.reflect.Method.invoke(Method.java:578)
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
[...]
Test run finished after 145 ms
[ 14 containers found ]
[ 0 containers skipped ]
[ 14 containers started ]
[ 0 containers aborted ]
[ 14 containers successful ]
[ 0 containers failed ]
[ 19 tests found ]
[ 0 tests skipped ]
[ 19 tests started ]
[ 0 tests aborted ]
[ 10 tests successful ]
[ 9 tests failed ]
make[1]: *** [debian/rules:21: override_dh_auto_test] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:9: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
---------------
-- System Information:
Debian Release: bookworm/sid
APT prefers lunar-updates
APT policy: (500, 'lunar-updates'), (500, 'lunar-security'), (500, 'lunar'), (100, 'lunar-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.2.0-33-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
More information about the pkg-java-maintainers
mailing list