#1146539 libfailsafe-java: FTBFS randomly: java.lang.AssertionError: expected [3] but found [2]

#1146539#5
Date:
2026-09-02 20:24:28 UTC
From:
To:
Hello Pierre et al.

This package fails to build for me 50% of the time (tried many times).

I've put several build logs here:

https://people.debian.org/~sanvila/build-logs/202609/

and as always, I'm offering a VM to reproduce (i.e. to reproduce the randomness in this case)
if required.

Note that the failing tests might be not always the same (that's why I put
several build logs in the above URL).

Thanks.
--------------------------------------------------------------------------------
[...]
BEFORE dev.failsafe.CircuitBreakerTest#shouldGetSuccessAndFailureStats
BEFORE dev.failsafe.FallbackBuilderTest#shouldCreateBuilderFromExistingConfig
[ERROR] Tests run: 305, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 30.949 s <<< FAILURE! - in TestSuite
[ERROR] testFallbackRetryPolicyTimeoutTimeout(dev.failsafe.functional.NestedTimeoutTest)  Time elapsed: 1.31 s  <<< FAILURE!
java.lang.AssertionError: expected [3] but found [2]
	at org.testng.Assert.fail(Assert.java:94)
	at org.testng.Assert.failNotEquals(Assert.java:513)
	at org.testng.Assert.assertEqualsImpl(Assert.java:135)
	at org.testng.Assert.assertEquals(Assert.java:116)
	at org.testng.Assert.assertEquals(Assert.java:389)
	at org.testng.Assert.assertEquals(Assert.java:399)
	at dev.failsafe.functional.NestedTimeoutTest.lambda$testFallbackRetryPolicyTimeoutTimeout$3(NestedTimeoutTest.java:89)
	at dev.failsafe.testing.Testing.lambda$testGetInternal$2(Testing.java:333)
	at dev.failsafe.testing.Testing.lambda$testGetInternal$7(Testing.java:366)
	at dev.failsafe.testing.Testing.testGetInternal(Testing.java:371)
	at dev.failsafe.testing.Testing.testRunSuccess(Testing.java:186)
	at dev.failsafe.functional.NestedTimeoutTest.lambda$testFallbackRetryPolicyTimeoutTimeout$0(NestedTimeoutTest.java:82)
	at dev.failsafe.functional.NestedTimeoutTest.testFallbackRetryPolicyTimeoutTimeout(NestedTimeoutTest.java:101)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1129)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at org.testng.TestRunner.privateRun(TestRunner.java:746)
	at org.testng.TestRunner.run(TestRunner.java:600)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)
	at org.testng.TestNG.runSuites(TestNG.java:1104)
	at org.testng.TestNG.run(TestNG.java:1076)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:193)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   NestedTimeoutTest.testFallbackRetryPolicyTimeoutTimeout:101->lambda$testFallbackRetryPolicyTimeoutTimeout$0:82->Testing.testRunSuccess:186->Testing.testGetInternal:371->Testing.lambda$testGetInternal$7:366->Testing.lambda$testGetInternal$2:333->lambda$testFallbackRetryPolicyTimeoutTimeout$3:89 expected [3] but found [2]
[INFO]
[ERROR] Tests run: 305, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Failsafe Parent 3.3.2:
[INFO]
[INFO] Failsafe Parent .................................... SUCCESS [  0.003 s]
[INFO] Failsafe ........................................... FAILURE [01:01 min]
[INFO] Failsafe OkHttp .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:02 min
[INFO] Finished at: 2026-09-02T16:10:17Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.3:test (default-test) on project failsafe: There are test failures.
[ERROR]
[ERROR] Please refer to /<<PKGBUILDDIR>>/core/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :failsafe
dh_auto_test: error: /usr/lib/jvm/default-java/bin/java -noverify -cp /usr/share/maven/boot/plexus-classworlds-2.x.jar -Dmaven.home=/usr/share/maven -Dmaven.multiModuleProjectDirectory=/<<PKGBUILDDIR>> -Dclassworlds.conf=/etc/maven/m2-debian.conf org.codehaus.plexus.classworlds.launcher.Launcher -s/etc/maven/settings-debian.xml -Ddebian.dir=/<<PKGBUILDDIR>>/debian -Dmaven.repo.local=/<<PKGBUILDDIR>>/debian/maven-repo --batch-mode test returned exit code 1
make: *** [debian/rules:4: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1146539#10
Date:
2026-09-02 21:13:37 UTC
From:
To:
Hi.

I forked the project in salsa, enabled CI/CD (which for some reason
was disabled by default) and got a build failure at the first try:

https://salsa.debian.org/sanvila/libfailsafe-java/-/pipelines

So that's another way to reproduce the failures.

Thanks.