RFR: 8335150: Test LogGeneratedClassesTest.java fails on rpmbuild mock enviroment [v3]
Jaikiran Pai
jpai at openjdk.org
Fri Jul 26 04:32:32 UTC 2024
On Thu, 25 Jul 2024 09:50:10 GMT, SendaoYan <syan at openjdk.org> wrote:
>> Hi all,
>> Test `test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java` fails on rpm build mock environment. The `df -h` command return fail `df: cannot read table of mounted file systems: No such file or directory` on the rpm build mock environment also. I think it's a environmental issue, and the environmental issue should not cause the test fails, it should skip the test.
>>
>> The rpmbuild mock enviroment is like a sandbox, which created by `chroot` shell command, in the rpmbuild mock enviroment, `df -h` report `cannot read table of mounted file systems`, and java Files.getFileStore also throw `IOException`. We want to build and test the jdk in this `sandbox`, and the default jtreg work directory is `JTWork` in current directory, so this testcase will report fails.
>>
>> Only change the testcase, the change has been verified locally, no risk.
>
> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>
> 1. Just catch the IOException here when getting the FileStore and skip the test instead of checking for specific exception messages. 2. Throw a org.testng.SkipException instead print and return
test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java line 217:
> 215: } catch (IOException e) {
> 216: e.printStackTrace();
> 217: throw new SkipException("WARNING: IOException occur. Skipping testDumpDirNotWritable test.");
Nit: "occurred" instead "occur". Additionally, I would suggest even the exception's toString() in that message just to provide additional context at the location wherever this will get reported outside of a .jtr (if at all). So something like:
throw new SkipException("WARNING: IOException occurred: " + e + ", Skipping testDumpDirNotWritable test.");
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19905#discussion_r1692498834
More information about the core-libs-dev
mailing list