Skip to content

Commit 4b37d97

Browse files
shyamkishororacleshipilev
authored andcommitted
8362602: Add test.timeout.factor to CompileFactory to avoid test timeouts
Backport-of: f8c8bcf4fd31509fdb40d32e8e16ba4fba1f987d
1 parent 28ed52d commit 4b37d97

File tree

1 file changed

+4
-2
lines changed
  • test/hotspot/jtreg/compiler/lib/compile_framework

1 file changed

+4
-2
lines changed

test/hotspot/jtreg/compiler/lib/compile_framework/Compile.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,6 +40,7 @@
4040
*/
4141
class Compile {
4242
private static final int COMPILE_TIMEOUT = 60;
43+
private static final float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0"));
4344

4445
private static final String JAVA_PATH = JDKToolFinder.getJDKTool("java");
4546
private static final String JAVAC_PATH = JDKToolFinder.getJDKTool("javac");
@@ -182,7 +183,8 @@ private static void executeCompileCommand(List<String> command) {
182183
int exitCode;
183184
try {
184185
Process process = builder.start();
185-
boolean exited = process.waitFor(COMPILE_TIMEOUT, TimeUnit.SECONDS);
186+
long timeout = COMPILE_TIMEOUT * (long)timeoutFactor;
187+
boolean exited = process.waitFor(timeout, TimeUnit.SECONDS);
186188
if (!exited) {
187189
process.destroyForcibly();
188190
System.out.println("Timeout: compile command: " + String.join(" ", command));

0 commit comments

Comments
 (0)