Test methods gets repeatedly executed (18 times) each run
See original GitHub issueI’ve been having this issue for a while, tests keep running longer and longer but naturally I figured it was in my code. I eventually found out that the test methods are being executed repeatedly (around 18 time) for each test run.
This is a stack trace produced from the EnumTest.class
enum_value
test method. I have removed all custom runners and anything else I can think of that might be wrong on my end. I also tried to look through the junit code to see if I can find out what is going on but I am lost for words now.
Please see if you can spot anything I am missing. Any suggestions would be much appreciated.
____________________________________
> bsh.Reflect.printStackTrace(Reflect.java:1297)
> bsh.EnumTest.enum_values(EnumTest.java:97)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> java.lang.reflect.Method.invoke(Method.java:498)
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
> org.junit.rules.RunRules.evaluate(RunRules.java:20)
> org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
____________________________________
> bsh.Reflect.printStackTrace(Reflect.java:1297)
> bsh.EnumTest.enum_values(EnumTest.java:97)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> java.lang.reflect.Method.invoke(Method.java:498)
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
> org.junit.rules.RunRules.evaluate(RunRules.java:20)
> org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
____________________________________
> bsh.Reflect.printStackTrace(Reflect.java:1297)
> bsh.EnumTest.enum_values(EnumTest.java:97)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> java.lang.reflect.Method.invoke(Method.java:498)
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
> org.junit.rules.RunRules.evaluate(RunRules.java:20)
> org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
And it continues to repeat like this for another 15 times. It happens on every test method in all the test classes.
Running JUnit 4.1.2 Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T21:49:05+02:00) Java version: 1.8.0_172, vendor: Oracle Corporation OS name: “mac os x”, version: “10.13.5”, arch: “x86_64”, family: “mac” maven-surefire-plugin v2.21.0 plain vanilla config I have removed jacoco and any java arglines I used before.
Ran out of ideas of things to try, looking for anything new to try.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Found the bug… Tx
@kcooney it was in my code after all, getting me to make a minimum reproducible was just the idea I needed to hunt it down.
Tyvm! You’re a SuperStar!! =)