Skip to content

Commit 39fd48e

Browse files
committed
[GR-63773] Disable tests that exercise the engine.InterpreterCallStackHeadRoomOption on platforms where the option is not supported.
PullRequest: graal/20458
2 parents 48c7bb2 + d2e2f84 commit 39fd48e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/SandboxPolicyTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import java.util.Properties;
5454
import java.util.Set;
5555

56-
import com.oracle.truffle.tck.tests.TruffleTestAssumptions;
5756
import org.graalvm.options.OptionCategory;
5857
import org.graalvm.options.OptionDescriptors;
5958
import org.graalvm.options.OptionKey;
@@ -79,8 +78,10 @@
7978
import com.oracle.truffle.api.Option;
8079
import com.oracle.truffle.api.Truffle;
8180
import com.oracle.truffle.api.TruffleLanguage;
81+
import com.oracle.truffle.api.TruffleOptions;
8282
import com.oracle.truffle.api.impl.DefaultTruffleRuntime;
8383
import com.oracle.truffle.api.instrumentation.TruffleInstrument;
84+
import com.oracle.truffle.tck.tests.TruffleTestAssumptions;
8485

8586
@RunWith(Parameterized.class)
8687
public class SandboxPolicyTest {
@@ -128,10 +129,20 @@ public static void tearDownClass() {
128129
}
129130
}
130131

132+
/**
133+
* A mirror of the method {@link SandboxInstrument#isInterpreterCallStackHeadRoomSupported()}
134+
* taking into account the possibility to run in polyglot isolate spawned form HotSpot.
135+
*/
136+
private static boolean isInterpreterCallStackHeadRoomSupported() {
137+
Runtime.Version jdkVersion = Runtime.version();
138+
return (TruffleTestAssumptions.isIsolateEncapsulation() || TruffleOptions.AOT) && jdkVersion.feature() >= 23;
139+
}
140+
131141
@Before
132142
public void setUp() {
133143
Assume.assumeFalse("Restricted Truffle compiler options are specified on the command line.",
134144
configuration.sandboxPolicy != SandboxPolicy.TRUSTED && executedWithXCompOptions());
145+
Assume.assumeTrue(configuration.sandboxPolicy != SandboxPolicy.UNTRUSTED || isInterpreterCallStackHeadRoomSupported());
135146
}
136147

137148
private static boolean executedWithXCompOptions() {

0 commit comments

Comments
 (0)