Derby
  1. Derby
  2. DERBY-5801

Sub-processes should write EMMA coverage data to separate files

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.10.1.1
    • Component/s: Test
    • Labels:
      None

      Description

      When generating EMMA coverage reports after running suites.All, I frequently see that coverage.ec is corrupted, and no report is produced. Typical failures look like this:

      java.io.UTFDataFormatException: malformed input around byte 52
      at java.io.DataInputStream.readUTF(DataInputStream.java:656)
      at java.io.DataInputStream.readUTF(DataInputStream.java:564)
      at com.vladium.emma.data.ClassDescriptor.readExternal(ClassDescriptor.java:171)
      at com.vladium.emma.data.MetaData.readExternal(MetaData.java:228)
      at com.vladium.emma.data.DataFactory.readEntry(DataFactory.java:770)
      at com.vladium.emma.data.DataFactory.mergeload(DataFactory.java:461)
      at com.vladium.emma.data.DataFactory.load(DataFactory.java:56)
      at com.vladium.emma.report.ReportProcessor._run(ReportProcessor.java:175)
      at com.vladium.emma.Processor.run(Processor.java:54)
      at com.vladium.emma.report.reportCommand.run(reportCommand.java:130)
      at emma.main(emma.java:40)

      or

      Exception in thread "main" com.vladium.emma.EMMARuntimeException: unexpected failure:
      at com.vladium.emma.Command.exit(Command.java:237)
      at com.vladium.emma.report.reportCommand.run(reportCommand.java:145)
      at emma.main(emma.java:40)
      Caused by: java.lang.OutOfMemoryError: Requested array size exceeds VM limit
      at java.util.HashMap.<init>(HashMap.java:181)
      at java.util.HashMap.<init>(HashMap.java:193)
      at com.vladium.emma.data.MetaData.readExternal(MetaData.java:223)
      at com.vladium.emma.data.DataFactory.readEntry(DataFactory.java:770)
      at com.vladium.emma.data.DataFactory.mergeload(DataFactory.java:461)
      at com.vladium.emma.data.DataFactory.load(DataFactory.java:56)
      at com.vladium.emma.report.ReportProcessor._run(ReportProcessor.java:175)
      at com.vladium.emma.Processor.run(Processor.java:54)
      at com.vladium.emma.report.reportCommand.run(reportCommand.java:130)
      ... 1 more

      I suspect that the problem is that all sub-processes spawned by the main test process write to the same file, sometimes multiple processes running at the same time, and that the file gets corrupted because there's no coordination between the processes when they're writing to it.

      Experiments I have run also indicate that making the sub-processes write to different files helps (I haven't managed to reproduce the corruption yet with that change), so I suggest we make that change.

      1. d5801-1a.diff
        3 kB
        Knut Anders Hatlen
      2. separate.diff
        1 kB
        Knut Anders Hatlen

        Activity

        Knut Anders Hatlen created issue -
        Knut Anders Hatlen made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Knut Anders Hatlen made changes -
        Attachment separate.diff [ 12531243 ]
        Knut Anders Hatlen made changes -
        Attachment d5801-1a.diff [ 12531254 ]
        Knut Anders Hatlen made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 10.10.0.0 [ 12321550 ]
        Resolution Fixed [ 1 ]
        Knut Anders Hatlen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gavin made changes -
        Workflow jira [ 12672382 ] Default workflow, editable Closed status [ 12797115 ]

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development