On Sun, 26 May 2024 02:58:02 GMT, SendaoYan <s...@openjdk.org> wrote:
> Hi all, > When there is no `/usr/bin/expect` in system, `throw new SkippedException` > will not make the jvm exit in `@BeforeAll` junit stage, thus this will cause > this testcase run failed. So I make change from `throw new SkippedException` > to `System.exit` to avoid this issue. When use `System.exit`, I think we > should use `othervm` mode in jtreg. > Only change the testcase, the risk is low. > > Thanks. Changes requested by djelinski (Reviewer). test/jdk/java/io/IO/IO.java line 64: > 62: expect = Paths.get("/usr/bin/expect"); // os-specific path > 63: if (!Files.exists(expect) || !Files.isExecutable(expect)) { > 64: System.out.println("jtreg.SkippedException: '" + expect + > "' not found"); SkippedException works with jtreg tests only. For jUnit you need to use [Assumptions.abort](https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/Assumptions.html#abort(java.lang.String)) ------------- PR Review: https://git.openjdk.org/jdk/pull/19403#pullrequestreview-2079411377 PR Review Comment: https://git.openjdk.org/jdk/pull/19403#discussion_r1615031307