Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2127

Resource temporarily unavailable when running tests that invoke Node using Surefire 3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-M7
    • None
    • Maven Surefire Plugin
    • None

    Description

      When running the Vaadin Flow test set using surefire 3.0.0-M7 we always end up with

       

      [SUREFIRE] std/in stream corrupted
      java.io.IOException: Resource temporarily unavailable
              at java.base/java.io.FileInputStream.readBytes(Native Method)
              at java.base/java.io.FileInputStream.read(FileInputStream.java:276)
              at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:282)
              at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
              at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)
              at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
              at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
              at org.apache.maven.surefire.api.util.internal.Channels$3.readImpl(Channels.java:217)
              at org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleReadableChannel.read(AbstractNoninterruptibleReadableChannel.java:54)
              at org.apache.maven.surefire.api.stream.AbstractStreamDecoder.read(AbstractStreamDecoder.java:484)
              at org.apache.maven.surefire.api.stream.AbstractStreamDecoder.read(AbstractStreamDecoder.java:470)
              at org.apache.maven.surefire.api.stream.AbstractStreamDecoder.readMessageType(AbstractStreamDecoder.java:118)
              at org.apache.maven.surefire.booter.stream.CommandDecoder.decode(CommandDecoder.java:87)
              at org.apache.maven.surefire.booter.spi.CommandChannelDecoder.decode(CommandChannelDecoder.java:67)
              at org.apache.maven.surefire.booter.CommandReader$CommandRunnable.run(CommandReader.java:345)
              at java.base/java.lang.Thread.run(Thread.java:833)
       

       

      This problem is introduced in SUREFIRE-1658, verified using git bisect

      It seems to occur in tests that invoke `pnpm` through `node` so potentially this is related to https://github.com/nodejs/node/issues/42826 as the error message "Resource temporarily unavailable" seems to refer to EAGAIN https://stackoverflow.com/a/4058377/3336733 or in other words that the file descriptor is in non-blocking mode and there is no data available to read.

       

      The Vaadin Flow PR where this has been tested is https://github.com/vaadin/flow/pull/15102

      Can be reproduced by checking out that branch (`upgrade-test-runners`) and running `mvn test`. It will fail on the `flow-server` module from where all tests except one have been removed.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Artur- Artur
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: