"""error: module testng reads package test from both test and testng"""

mandy chung mandy.chung at oracle.com
Tue Aug 29 22:02:45 UTC 2017


Jon,

(I took out jigsaw-dev and core-lib-dev.  Just include jtreg-dev as now 
this is a question to jtreg.

Is there any way to diagnose the issue Martin runs into?  His jtr file 
shows that compilation environment sets up the proper module path and 
--add-modules.  But the runtime is different that causes the test fails 
to initialize as it requires testng module.

javac compilation environment
   add modules: testng jcommander
   module path: /home/martin/ws/jdk10/jdk/test/JTwork/modules

ACTION: testng -- Failed. Unexpected exit from test [exit code: 1]
REASON: User specified action: run testng/othervm test/test.Main
TIME:   0.215 seconds
messages:
command: testng test/test.Main
reason: User specified action: run testng/othervm test/test.Main
Mode: othervm [/othervm specified]
elapsed time (seconds): 0.215
configuration:
Boot Layer
   add modules: test m4 m2 m3 m1
   module path: 
/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules

Mandy

On 8/22/17 7:26 PM, Martin Buchholz wrote:
> Indeed, when I rerun the command with your suggested module-path, it 
> works (I had never used "rerun" before).
> So why does my jtreg not make these modules available at runtime?  
> This is a fairly ordinary Ubuntu 14.4 system.
>
>  $ DISPLAY=localhost:10.0 \
> HOME=/home/martin \
> LANG=en_US.UTF-8 \
> PATH=/bin:/usr/bin \
> CLASSPATH=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d:/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX:/home/martin/jtreg-binaries/4.2-b08-testng-6.9.9/lib/testng.jar:/home/martin/jtreg-binaries/4.2-b08-testng-6.9.9/lib/jcommander.jar:/home/martin/jtreg-binaries/4.2-b08-testng-6.9.9/lib/javatest.jar:/home/martin/jtreg-binaries/4.2-b08-testng-6.9.9/lib/jtreg.jar 
> \
> /home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk/bin/java 
> \
> -Dtest.class.path.prefix=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d:/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX 
> \
> -Dtest.src=/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX \
> -Dtest.src.path=/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX 
> \
> -Dtest.classes=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d 
> \
> -Dtest.class.path=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d 
> \
> -Dtest.vm.opts=-enablesystemassertions \
> -Dtest.tool.vm.opts=-J-enablesystemassertions \
> -Dtest.compiler.opts= \
> -Dtest.java.opts= \
> -Dtest.jdk=/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk 
> \
> -Dcompile.jdk=/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk 
> \
> -Dtest.timeout.factor=1.0 \
>         --module-path 
> /home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules:"/home/martin/ws/jdk10/jdk/test/JTwork/modules" 
> \
>         --add-modules test,m4,m2,m3,m1 \
> -enablesystemassertions \
> com.sun.javatest.regtest.agent.MainWrapper 
> /home/martin/ws/jdk10/jdk/test/JTwork/java/lang/ModuleTests/addXXX/Driver.d/testng.0.jta 
> java/lang/ModuleTests/addXXX/Driver.java false test/test.Main
> [TestNG] Running:
> java/lang/ModuleTests/addXXX/Driver.java
>
> test test.Main.testAddExports(): success
> test test.Main.testAddOpens(): success
> test test.Main.testAddReads(): success
> test test.Main.testAddUses(): success
>
> ===============================================
> java/lang/ModuleTests/addXXX/Driver.java
> Total tests run: 4, Failures: 0, Skips: 0
> ===============================================
>
> STATUS:Passed.
>
> On Tue, Aug 22, 2017 at 6:48 PM, mandy chung <mandy.chung at oracle.com 
> <mailto:mandy.chung at oracle.com>> wrote:
>
>     The error message is clear because testng is not found from the
>     module path.
>
>     Error occurred during initialization of boot layer
>     java.lang.module.FindException: Module testng not found, required
>     by test
>
>     If you edit the rerun command from jtr file to add JTwork/modules
>     to module path as follows:
>
>     --module-path /home/martin/ws/jdk10/jdk/
>     test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules:/home/martin/ws/jdk10/jdk/
>
>     test/JTwork/modules
>
>     If it runs successfully, then the question is why jtreg includes
>     JTwork/modules in javac --module-path but not at run time in your
>     local run but my local jtreg works fine.  Jon may have jtreg
>     debugging tip.
>
>     Mandy
>
>     On 8/22/17 6:18 PM, Martin Buchholz wrote:
>>     I also tried upgrading jcommander.jar to 1.72 from 1.48, but get
>>     the same error.
>>     Debugging hints?
>>
>>
>>     On Tue, Aug 22, 2017 at 4:28 PM, mandy chung
>>     <mandy.chung at oracle.com <mailto:mandy.chung at oracle.com>> wrote:
>>
>>
>>         On 8/22/17 3:52 PM, Martin Buchholz wrote:
>>>         :
>>>
>>>
>>>         ACTION: testng -- Failed. Unexpected exit from test [exit
>>>         code: 1]
>>>         REASON: User specified action: run testng/othervm
>>>         test/test.Main
>>>         TIME:   0.215 seconds
>>>         messages:
>>>         command: testng test/test.Main
>>>         reason: User specified action: run testng/othervm
>>>         test/test.Main
>>>         Mode: othervm [/othervm specified]
>>>         elapsed time (seconds): 0.215
>>>         configuration:
>>>         Boot Layer
>>>           add modules: test m4 m2 m3 m1
>>>         module path:
>>>         /home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules
>>>
>>>         STDOUT:
>>>         Error occurred during initialization of boot layer
>>>         java.lang.module.FindException: Module testng not found,
>>>         required by test
>>>         STDERR:
>>>         rerun:
>>>         DISPLAY=localhost:10.0 \
>>>         HOME=/home/martin \
>>>         LANG=en_US.UTF-8 \
>>>         PATH=/bin:/usr/bin \
>>>         CLASSPATH=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d:/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX:/home/martin/jtreg-binaries/4.2-b08/lib/testng.jar:/home/martin/jtreg-binaries/4.2-b08/lib/jcommander.jar:/home/martin/jtreg-binaries/4.2-b08/lib/javatest.jar:/home/martin/jtreg-binaries/4.2-b08/lib/jtreg.jar
>>>         \
>>>         /home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk/bin/java
>>>         \
>>>         -Dtest.class.path.prefix=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d:/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX
>>>         \
>>>         -Dtest.src=/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX
>>>         \
>>>         -Dtest.src.path=/home/martin/ws/jdk10/jdk/test/java/lang/ModuleTests/addXXX
>>>         \
>>>         -Dtest.classes=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d
>>>         \
>>>         -Dtest.class.path=/home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d
>>>         \
>>>         -Dtest.vm.opts=-enablesystemassertions \
>>>         -Dtest.tool.vm.opts=-J-enablesystemassertions \
>>>           -Dtest.compiler.opts= \
>>>           -Dtest.java.opts= \
>>>         -Dtest.jdk=/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk
>>>         \
>>>         -Dcompile.jdk=/home/martin/ws/jdk10/build/linux-x86_64-normal-server-release/images/jdk
>>>         \
>>>           -Dtest.timeout.factor=1.0 \
>>>           --module-path
>>>         /home/martin/ws/jdk10/jdk/test/JTwork/classes/java/lang/ModuleTests/addXXX/Driver.d/modules
>>>         \
>>
>>         ====> /home/martin/ws/jdk10/jdk/test/JTwork/modules is not in
>>         the module path.  Therefore testng is not found.
>>
>>         I can't reproduce this error.  I downloaded testng 6.9.9 and
>>         it works for me.  This is the jtreg version I used.
>>
>>         $ jtreg -version
>>         jtreg, version 4.2 fcs b08
>>         Installed in /java/devtools/jtreg/jtreg-4.2/lib/jtreg.jar
>>         Running on platform version 9 from
>>         /java/re/jdk-9.jdk/Contents/Home.
>>         Built with Java(TM) 2 SDK, Version 1.7.0-b147 on July 21, 2017.
>>         Copyright (c) 1999, 2016, Oracle and/or its affiliates. All
>>         rights reserved.
>>         Use is subject to license terms.
>>         JCov 2.0-b18 beta
>>         TestNG (testng.jar): version 6.9.9
>>         TestNG (jcommander.jar): version 1.72
>>
>>
>>         Mandy
>>>         --add-modules test,m4,m2,m3,m1 \
>>>         -enablesystemassertions \
>>>         com.sun.javatest.regtest.agent.MainWrapper
>>>         /home/martin/ws/jdk10/jdk/test/JTwork/java/lang/ModuleTests/addXXX/Driver.d/testng.0.jta
>>>         java/lang/ModuleTests/addXXX/Driver.java false test/test.Main
>>>
>>>         TEST RESULT: Failed. Unexpected exit from test [exit code: 1]
>>
>>
>
>



More information about the jtreg-dev mailing list