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

Propagate verbose flag to agents

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jtreg7.5
    • jtreg7.1
    • tools

      Suppose I'm working in test/jdk/java/util/concurrent/tck
      and I add a new test method

          public void testJustFail() { throw new Error("Just Fail"); }

      to some file, e.g. DelayQueueTest.java

      I run tests like this:

      jtreg -jdk ~/jdk/jdk21 -v:nopass,error,fail .

      but the output contains no hint of the test file or test method.
      Only thousands of lines like

      STARTED ForkJoinPool20Test::testExternalSubmitWithNull 'testExternalSubmitWithNull'
      SUCCESSFUL ForkJoinPool20Test::testExternalSubmitWithNull 'testExternalSubmitWithNull'

      and the unhelpful stack trace

      java.lang.Exception: JUnit test failure
      at com.sun.javatest.regtest.agent.JUnitRunner.runWithJUnitPlatform(JUnitRunner.java:149)
      at com.sun.javatest.regtest.agent.JUnitRunner.main(JUnitRunner.java:95)
      at com.sun.javatest.regtest.agent.JUnitRunner.main(JUnitRunner.java:61)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.base/java.lang.reflect.Method.invoke(Method.java:578)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
      at java.base/java.lang.Thread.run(Thread.java:1623)

      I know how to rebuild jtreg, so I upgrade to the latest:

      jtreg 7.2-dev+0
      Installed in /home/martin/jtreg-binaries/7.2-2023-02/lib/jtreg.jar
      Running on platform version 18.0.2-ea from /usr/lib/jvm/java-18-openjdk-amd64.
      Built with Java(TM) 2 SDK, Version 17.0.6+10 on February 28, 2023.
      Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
      Use is subject to license terms.
      JT Harness, version 6.0 ea b24 (February 28, 2023)
      Java Assembler Tools, version 7.0 ea b09 (February 28, 2023)
      TestNG: testng-7.3.0.jar, guice-4.2.3.jar, jcommander-1.78.jar
      JUnit: junit-platform-console-standalone-1.9.2.jar

      ... but that does not help.

      I notice this:

      If you need to see more of the output from the test,
      set the system property javatest.maxOutputSize to a higher
      value. The current value is 100000

      So I try instead

      jtreg -jdk ~/jdk/jdk21 -javaoption:-Djavatest.maxOutputSize=1000000000 -vmoption:-Djavatest.maxOutputSize=1000000000 -Djavatest.maxOutputSize=1000000000 -v:nopass,error,fail .

      but that does not help.

      It looks like there's no way to suppress useless output for PASSed junit methods.

      I couldn't find any jtreg guidance related to junit 5.

            cstein Christian Stein
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: