Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901571

ant jtreg task in 4.1-b12 needs to auto-create text html subdirectories

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: jtreg4.1
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b13
    • CPU:
      generic
    • OS:
      generic

      Description

      jsr166 runs jtreg via its ant task.
      http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/build.xml?view=markup
      The key part is this:
          <delete dir="@{workdir}/JTwork" quiet="true"/>
          <delete dir="@{workdir}/JTreport" quiet="true"/>
          <mkdir dir="@{workdir}/JTwork/scratch"/>
          <mkdir dir="@{workdir}/JTreport"/>
          <jtreg dir="${jtreg@{target}.src.dir}"

      After upgrading to 4.1-b12 I started seeing:
      $ ant jtreg
      ...
          [jtreg] Test results: passed: 199
          [jtreg] Error while writing report: java.io.FileNotFoundException: /home/martin/jsr166/jtreg-4.2/build/JTreport/text/timeStats.txt (No such file or directory)
          [jtreg] Results written to /home/martin/jsr166/jtreg-4.2/build/JTwork

      BUILD SUCCESSFUL

      I expect the text subdirectory to be created automatically, and I also expect the build to fail if I get an I/O error.

      If I create the directory before running jtreg

           <mkdir dir="@{workdir}/JTreport"/>
      + <mkdir dir="@{workdir}/JTreport/text"/>
           <jtreg dir="${jtreg@{target}.src.dir}"

      I get the unexpected

      BUILD FAILED
      /home/martin/jsr166/jtreg-4.2/build.xml:527: The following error occurred while executing this line:
      /home/martin/jsr166/jtreg-4.2/build.xml:318: java.lang.NullPointerException
      at com.sun.javatest.regtest.RegressionReporter.fixupReportFiles(RegressionReporter.java:264)
      at com.sun.javatest.regtest.RegressionReporter.fixupReports(RegressionReporter.java:248)
      at com.sun.javatest.regtest.RegressionReporter.report(RegressionReporter.java:107)
      at com.sun.javatest.regtest.Main.batchHarness(Main.java:1899)
      at com.sun.javatest.regtest.Main.run(Main.java:1264)
      at com.sun.javatest.regtest.Main.access$4900(Main.java:99)
      at com.sun.javatest.regtest.Main$Ant.execute(Main.java:886)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:435)
      at org.apache.tools.ant.Target.performTasks(Target.java:456)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
      at org.apache.tools.ant.Main.runBuild(Main.java:851)
      at org.apache.tools.ant.Main.startAnt(Main.java:235)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


      If I go further and create both html and text subdirectories,

          <mkdir dir="@{workdir}/JTreport/html"/>
          <mkdir dir="@{workdir}/JTreport/text"/>
          <jtreg dir="${jtreg@{target}.src.dir}"

      I succeed! So that's a pretty good workaround, but please:

      - create all needed directories automatically, on demand
      - If there is an I/O error, then make sure to fail the build
      - For most I/O errors, we should have a meaningful error on stderr - no stack trace unless it's a jtreg bug

        Attachments

          Activity

            People

            • Assignee:
              jjg Jonathan Gibbons
              Reporter:
              martin Martin Buchholz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: