Skip to content

Commit

Permalink
Filter out explicitly selected GCs
Browse files Browse the repository at this point in the history
(cherry picked from commit f57c8f3)
  • Loading branch information
tkrodriguez authored and marwan-hallaoui committed Oct 3, 2023
1 parent 7e2bd5c commit 003cca1
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
package org.graalvm.compiler.hotspot.test;

import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.graalvm.compiler.core.test.SubprocessTest;
import org.junit.Test;
Expand All @@ -50,16 +52,22 @@ public static void testSnippet() {
}

public void runSubprocessTest(String... args) throws IOException, InterruptedException {
List<String> newArgs = new ArrayList<>();
Collections.addAll(newArgs, args);
// Filter out any explicitly selected GC
newArgs.remove("-XX:+UseZGC");
newArgs.remove("-XX:+UseG1GC");
newArgs.remove("-XX:+UseParallelGC");

launchSubprocess(() -> {
test("testSnippet");
}, args);
}, newArgs.toArray(new String[0]));

// Test without assertions as well
String[] newArgs = Arrays.copyOf(args, args.length + 1);
newArgs[args.length] = "-da";
newArgs.add("-da");
launchSubprocess(() -> {
test("testSnippet");
}, newArgs);
}, newArgs.toArray(new String[0]));
}

@Test
Expand Down

0 comments on commit 003cca1

Please sign in to comment.