RFR: 8334333: MissingResourceCauseTestRun.java fails if run by root

Naoto Sato naoto at openjdk.org
Mon Jun 17 18:55:44 UTC 2024


On Sat, 15 Jun 2024 09:56:53 GMT, SendaoYan <syan at openjdk.org> wrote:

> Hi all,
> Testcase `test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTestRun.java` run fails with root user privileged. I think it's necessary to skip this testcase when user is root.
> Why run the jtreg test by root user? It's because during rpmbuild process for linux distribution of JDK, root user is the default user to build the openjdk, also is the default user to run the `make test-tier1`, this PR make this testcase more robustness.
> The change has been verified, only change the testcase, no risk.

test/jdk/java/util/ResourceBundle/Control/MissingResourceCauseTestRun.java line 60:

> 58:     public static void main(String[] args) throws Throwable {
> 59:         if(Platform.isRoot() && !Platform.isWindows()) {
> 60:             throw new SkippedException("root user has privileged will make this test fail.");

The exception message can be improved. How about "Unable to create an unreadable properties file"?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19732#discussion_r1643295899


More information about the core-libs-dev mailing list