Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot re-execute "Test File" without BUILD FAILURE #5122

Closed
pdurbin opened this issue Oct 1, 2018 · 5 comments
Closed

Cannot re-execute "Test File" without BUILD FAILURE #5122

pdurbin opened this issue Oct 1, 2018 · 5 comments
Assignees

Comments

@pdurbin
Copy link
Member

pdurbin commented Oct 1, 2018

I'm on 6eecbf1 on the 4261-sitemap branch (pull request #5084) and seeing some strange behavior with running unit tests, perhaps because pull request #5071 was recently merged.

When I run SiteMapUtilTest with "Test File" in Netbeans as described at http://guides.dataverse.org/en/4.9.2/developers/testing.html#writing-unit-tests-with-junit it works fine and the tests pass, but only if I do a mvn clean first. Here are some screenshots with the steps I'm using to reproduce. I'm using Netbeans 8.2.

First, I run a mvn clean (no changes have been made to the code):

screen shot 2018-10-01 at 9 52 18 am

Then I click "Test File":

screen shot 2018-10-01 at 9 43 10 am

The first "Test File" works:

screen shot 2018-10-01 at 9 44 08 am

Then I click "Test File" again:

screen shot 2018-10-01 at 9 44 19 am

The second "Test File" results in BUILD FAILURE:

screen shot 2018-10-01 at 9 44 59 am

Here are the details of the failure in the screenshot above:

------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.040s
Finished at: Mon Oct 01 09:44:42 EDT 2018
Final Memory: 26M/564M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test (default-cli) on project dataverse: There are test failures.

Please refer to /Users/pdurbin/NetBeansProjects/dataverse/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/pdurbin/NetBeansProjects/dataverse && /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/bin/java '${argLine}' -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Duser.language=en -Duser.region=US -jar /Users/pdurbin/NetBeansProjects/dataverse/target/surefire/surefirebooter8926035618084320581.jar /Users/pdurbin/NetBeansProjects/dataverse/target/surefire 2018-10-01T09-44-42_201-jvmRun1 surefire353471048469144277tmp surefire_05549499524846273060tmp
Error occurred in starting fork, check output in log
Process Exit Code: 1
org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
Command was /bin/sh -c cd /Users/pdurbin/NetBeansProjects/dataverse && /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre/bin/java '${argLine}' -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Duser.language=en -Duser.region=US -jar /Users/pdurbin/NetBeansProjects/dataverse/target/surefire/surefirebooter8926035618084320581.jar /Users/pdurbin/NetBeansProjects/dataverse/target/surefire 2018-10-01T09-44-42_201-jvmRun1 surefire353471048469144277tmp surefire_05549499524846273060tmp
Error occurred in starting fork, check output in log
Process Exit Code: 1
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1194)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1022)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:868)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@poikilotherm
Copy link
Contributor

Hey @pdurbin,

I just tried this on my dev machine. Not using Netbeans, but as you were wondering if the JUnit 5 stuff might brake things: the test seems to be perfectly fine.

The test is passing with mvn test -Dtest=SiteMapUtilTest every time, even after 10 iterations.
Running the test after a clean from IDEA 2018.1 is also working for multiple iterations (had again about 10).

This might be related to Netbeans IDE handling of tests. Does the build break on the console using mvn, too?

@pdurbin
Copy link
Member Author

pdurbin commented Oct 1, 2018

@poikilotherm I just ran mvn test -Dtest=SiteMapUtilTest three times in a row and got "BUILD SUCCESS" each time. It's important to use for "Test File" to continue to work in Netbeans. I don't think any of us have upgraded to Netbeans 9 yet. Are you willing to install Netbeans 8.2 and make an attempt to replicate the problem above?

@pdurbin
Copy link
Member Author

pdurbin commented Oct 1, 2018

@poikilotherm and I have been discussing this issue at http://irclog.iq.harvard.edu/dataverse/2018-10-01 and said I could assign it to him. Thanks! I dragged it to "Community Dev" at https://waffle.io/IQSS/dataverse

Something else we could try is re-executing an older test file that's been in the code base for a while.

poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Oct 1, 2018
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Oct 2, 2018
@poikilotherm
Copy link
Contributor

poikilotherm commented Oct 2, 2018

@pdurbin could you trigger review and/or QA for PR #5127? Seems ready for me, successfully resolving your problem.

(I could reproduce it with NetBeans 8.2: the ${argLine} is escaped by NetBeans and thus JVM is complaining about a missing main class named like the var and exits immediately.)

@pdurbin
Copy link
Member Author

pdurbin commented Oct 2, 2018

@poikilotherm thanks for pull request #5127! I tested it by making a new branch off my sitemap branch and merging your pull request it. Then I ran "Test File" a few times from Netbeans on SiteMapUtilTest and it worked fine. Back to normal. Off to QA. Thanks again!

@pdurbin pdurbin removed their assignment Oct 2, 2018
@kcondon kcondon self-assigned this Oct 2, 2018
@kcondon kcondon closed this as completed in cad9cb4 Oct 3, 2018
@pdurbin pdurbin added this to the 4.9.4 milestone Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants