Yeah, it definitely is an issue with path conversion on WSL. jtreg is jumping back and forth between the Windows and the Linux world. For instance, it sets
TESTSRC=C:/localdata/hg/sandbox-ALT/open/test/jdk/java/lang/Class/forName
using Windows paths, but then calls
    wsl.exe \
        sh /mnt/c/localdata/hg/sandbox-ALT/open/test/jdk/java/lang/Class/forName/NonJavaNames.sh
using unix paths and  a unix shell. So, unsurprisingly, we get:
cp: cannot stat 'C:/localdata/hg/sandbox-ALT/open/test/jdk/java/lang/Class/forName/classes/hyphen.class': No such file or directory

One added complexity on WSL, compared to cygwin, is that not all unix paths have a Windows equivalent. Only data located on Windows drives (C: or, from WSL, /mnt/c, etc) can be shared, stuff on e.g. /usr is inaccessible from Windows. I don't know if this can be a problem for jtreg shell tests. But it means for instance that you cannot trivially have e.g. PROG=/bin/true and suppose you can trivially transcripe the path for PROG between unix and windows formats. So you need to be careful what kind of paths you are using. Which is unlike cygwin, were you could be quite sloppy about those things, and just convert the paths back and fro.

/Magnus

On 2020-05-15 09:08, Magnus Ihse Bursie wrote:


On 2020-05-14 19:00, Jonathan Gibbons wrote:
Separate from this RFR, jtreg supports WSL (or is supposed to!) and so I wonder if you have looked at using WSL in the run-tests framework.

I just did "make test-tier1", and got this:

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS FAIL ERROR
   jtreg:open/test/hotspot/jtreg:tier1                1527  1527 0     0
>> jtreg:open/test/jdk:tier1                          1918 1902    16     0 << >> jtreg:open/test/langtools:tier1                    4037 4028     9     0 <<
   jtreg:open/test/jaxp:tier1                            0     0 0     0
==============================
TEST FAILURE


So, it's not DOA, we can  certainly run tests. But I got in total 25 failures, and it seems likely that these are caused by quirks in the WSL environment. I looked at a few arbitrarily selected, and all of them where shell tests that had the same failure mode:

ACTION: shell -- Failed. Execution failed: exit code 2
REASON: User specified action: run shell Class-Path2.sh
TIME:   0.098 seconds
messages:
command: shell Class-Path2.sh
reason: User specified action: run shell Class-Path2.sh
elapsed time (seconds): 0.098
STDOUT:
STDERR:
/mnt/c/localdata/hg/sandbox-ALT/open/test/langtools/tools/javac/Paths/Class-Path2.sh: 34: .: Can't open C:/localdata/hg/sandbox-ALT/open/test/langtools/tools/javac/Paths/Util.sh

... which definitely sounds fishy.

/Magnus


Reply via email to