File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
test/jdk/tools/jlink/plugins Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,16 @@ public class AddSapMachineToolsTest {
5959
6060 @ Test
6161 public void testSapMachineTools () throws IOException {
62- // async profiler is only available on restricted set of platforms and not in Github Actions builds
63- String gha = System .getenv ("GITHUB_ACTIONS" );
64- boolean shouldHaveAsync = (gha == null || !gha .contains ("true" )) &&
65- (Platform .isOSX () ||
66- (Platform .isLinux () && (Platform .isAArch64 () || Platform .isPPC () || Platform .isX64 ()) && !Platform .isMusl ()));
62+ // async profiler is not pulled in GHA builds, so skip the test there.
63+ // checking whether we are in a GHA environment is hacky because jtreg removes environment variables,
64+ // so we guess by checking for a user name containing the String "runner"
65+ if (System .getProperty ("user.name" , "n/a" ).contains ("runner" )) {
66+ throw new SkippedException ("Detected a Github Actions environment. No tools get added to SapMachine here, so skip test." );
67+ }
68+
69+ // async profiler is only available on a subset of platforms
70+ boolean shouldHaveAsync = Platform .isOSX () ||
71+ (Platform .isLinux () && (Platform .isAArch64 () || Platform .isPPC () || Platform .isX64 ()) && !Platform .isMusl ());
6772
6873 Path sourceJavaHome = Path .of (System .getProperty ("java.home" ));
6974
You can’t perform that action at this time.
0 commit comments