Build failing because of test TestDuplicatesAndScore

20 views
Skip to first unread message

Dario Salvatore Romano

unread,
Mar 9, 2020, 1:31:36 PM3/9/20
to robocode-developers
Hello, I've tried to run the mvnassembly script, but it fails on the test "net.sf.robocode.test.robots.TestDuplicatesAndScore".
The stacktrace of the error is:
run(net.sf.robocode.test.robots.TestDuplicatesAndScore)  Time elapsed: 0.614 sec  <<< FAILURE!
java.lang.AssertionError:
Expected: is "sampleteam.MyFirstLeader (1)"
     but: was "sampleteam.MyFirstLeader (2)"
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.junit.Assert.assertThat(Assert.java:865)
        at org.junit.Assert.assertThat(Assert.java:832)
        at net.sf.robocode.test.robots.TestDuplicatesAndScore.runTeardown(TestDuplicatesAndScore.java:119)
        at net.sf.robocode.test.helpers.RobocodeTestBed.run(RobocodeTestBed.java:181)
        at net.sf.robocode.test.robots.TestDuplicatesAndScore.run(TestDuplicatesAndScore.java:33)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

I've tried to run the command with openJDK 8 first, but then saw that you recommended the Oracle JDK 8, which then produced the same error for me.
Is this a problem on my end, or could there be a bug somewhere?

Thanks in advance. 

Flemming Larsen

unread,
Mar 9, 2020, 1:36:09 PM3/9/20
to robocode-developers
Unfortunately, the unit tests does not always run consistently across different systems. I use them when building new distribution files. But you don't have to if you just want to play around with the code. :-)
You could disable this single test. But you could also disable all the tests.

In order to disable the test, just change the mvnassembly.cmd (Windows) or mvnassembly.sh (Linux/MacOS):

Change this line:
mvnw clean install ant:ant -DskipTests=false

...into this:
mvnw clean install ant:ant -DskipTests=true


I hope this helps. :-)
Reply all
Reply to author
Forward
0 new messages