question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test methods gets repeatedly executed (18 times) each run

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nickl-commented, Jul 5, 2018

Found the bug… Tx

0reactions
nickl-commented, Jul 8, 2018

@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!! =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Botched Executions - Death Penalty Information Center
Botched executions occur when there is a breakdown in, or departure from, the “protocol” for a particular method of execution.
Read more >
After 18 botched IV attempts on a screaming, bleeding inmate ...
The Supreme Court has ruled that execution by lethal injection does not constitute cruel and unusual punishment.
Read more >
Running JUnit Tests Repeatedly Without Loops - Code Affine
This post illustrates the possibility of using JUnit Rules to execute a test repeatedly. It is based on a real world example to...
Read more >
What is Regression Testing? Definition, Tools, Method, and ...
Regression test is like a verification method. Test cases are generally automated as test cases are required to be executed again and again ......
Read more >
Inmate Autopsies Reveal Troubling Effects Of Lethal Injection
For decades, states have claimed that lethal injection is quick, peaceful and painless. An NPR investigation — and legal battles across the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found