Skip to content

Commit 461d3bd

Browse files
committed
8300205: Swing test bug8078268 make latch timeout configurable
Backport-of: e82dc6935b5f575a53fcba9c96767cee1b535cb8
1 parent b2069bc commit 461d3bd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/jdk/javax/swing/text/html/parser/Parser/8078268/bug8078268.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2023, 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
@@ -38,7 +38,8 @@
3838
@run main bug8078268
3939
*/
4040
public class bug8078268 {
41-
private static final long TIMEOUT = 10_000;
41+
private static final float tf = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0"));
42+
private static final long TIMEOUT = 10_000 * (long)tf;
4243

4344
private static final String FILENAME = "slowparse.html";
4445

@@ -61,7 +62,7 @@ public void run() {
6162
});
6263

6364
if (!latch.await(TIMEOUT, MILLISECONDS)) {
64-
throw new RuntimeException("Parsing takes too long.");
65+
throw new RuntimeException("Parsing takes too long. Current timeout is " + TIMEOUT);
6566
}
6667
if (exception != null) {
6768
throw exception;

0 commit comments

Comments
 (0)