[GRADLE-2720] JSCover - MessageIOException (gradle-1.5-rc-3) Created: 25/Mar/13  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.5-rc-3
Fix Version/s: None

Type: Bug
Reporter: tntim96 Assignee: Unassigned
Resolution: Won't Fix Votes: 1

Attachments: Text File err.txt     Text File out_1.txt     Text File out_2.txt    


I was looking at converting JSCover's build (https://github.com/tntim96/JSCover/) from Ant to Gradle, but get the following error when running `gradle acceptanceTest`

Unexpected exception thrown.
org.gradle.messaging.remote.internal.MessageIOException: Could not read message from '/'.

The gradle build is shown below. As well as checking out JSCover, you need to unzip HtmlUnit-2.12 to the same parent directory. Tests run fine in Ant, IntelliJ and Eclipse.

I am new to Gradle, so apologies if it's a silly mistake, but couldn't find anyone with similar issues. I also notice the error still occurs when running a single test.

apply plugin:'java'

sourceCompatibility = 1.5

sourceSets {
    integrationTest {
        java.srcDir file('src/test-integration/java')
        resources.srcDir file('src/test-integration/resources')
    acceptanceTest {
        java.srcDir file('src/test-acceptance/java')
        resources.srcDir file('src/test-acceptance/resources')

dependencies {
    compile fileTree(dir: 'lib/runtime', include: '**/*.jar')
    testCompile fileTree(dir: 'lib', include: '**/*.jar')
    integrationTestCompile sourceSets.main.output
    integrationTestCompile configurations.testCompile
    integrationTestCompile sourceSets.test.output
    integrationTestRuntime configurations.testRuntime
    acceptanceTestCompile sourceSets.main.output
    acceptanceTestCompile configurations.testCompile
    acceptanceTestCompile sourceSets.test.output
    acceptanceTestCompile fileTree(dir: '../htmlunit-2.12/lib', include: '**/*.jar')
    acceptanceTestRuntime configurations.testRuntime

task integrationTest(type: Test) {
    testClassesDir = sourceSets.integrationTest.output.classesDir
    classpath = sourceSets.integrationTest.runtimeClasspath

task acceptanceTest(type: Test) {
    testClassesDir = sourceSets.acceptanceTest.output.classesDir
    classpath = sourceSets.acceptanceTest.runtimeClasspath

check.dependsOn integrationTest, acceptanceTest

Comment by Adam Murdoch [ 27/Mar/13 ]

Do you have the full stack for the failure?

Comment by tntim96 [ 28/Mar/13 ]

I've attached the standard and error output. The process hangs and has to be manually ended.

Comment by Adam Murdoch [ 02/Apr/13 ]

Looks like the test is throwing an exception that cannot be deserialized in the build process. Gradle should deal with this, so it looks like there's something broken in there. Can you get more details from the logging to see what kind of exception is being thrown by the tests?

Comment by tntim96 [ 02/Apr/13 ]

I'll try, however, this is easy to replicate:

  1. Checkout https://github.com/tntim96/JSCover.git
  2. Download HTML Unit 2.12 and extract to the same parent directory as JSCover
  3. Copy in build.gradle code from above
  4. Run `gradle acceptanceTest`
Comment by tntim96 [ 02/Apr/13 ]

OK, I've attached out.txt when running with debug.

The output has an error, 'Caused by: java.net.BindException: Address already in use: JVM_Bind'. Does Gradle automatically try to run test concurrently? http://www.gradle.org/docs/current/userguide/java_plugin.html states that maxParallelForks defaults to 1.

Comment by tntim96 [ 03/Apr/13 ]

OK. My issue is solved by adding `forkEvery = 1` for the acceptance tests, but you may want to keep this open to have gradle handle the BindException deserialisation.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:29:39 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.