RFR: 8335150: Test LogGeneratedClassesTest.java fails on rpmbuild mock enviroment [v2]

Jaikiran Pai jpai at openjdk.org
Thu Jul 25 04:56:31 UTC 2024


On Wed, 26 Jun 2024 15:40:36 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.
>> 
>> 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:
> 
>   add a word throw

test/jdk/java/lang/invoke/lambda/LogGeneratedClassesTest.java line 216:

> 214:         } catch (IOException e) {
> 215:             if (e.getMessage().contains("Mount point not found")) {
> 216:                 // We would like to skip the test with a cause with

Hello @sendaoYan, it feels very specific and odd to be checking only for this exception message. This test method's goal appears to be to create a read-only directory into which it wants to write out the proxy classes and verify that it won't be able to do that. For that it first verifies that the underlying `FileStore` supports posix file attributes. If it's not able to ascertain that the underlying `FileStore` has posix support, then it skips the test.

So I think we should just catch the `IOException` here when getting the FileStore and skip the test instead of checking for specific exception messages. While we are at it, we should throw a `org.testng.SkipException` (this is a testng test) from this method wherever we are currently skipping the test execution by writing out a System.out warning message and returning.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19905#discussion_r1690807453


More information about the core-libs-dev mailing list