8300205: Swing test bug8078268 make latch timeout configurable

Reviewed-by: aivanov, serb
This commit is contained in:
Matthias Baesken 2023-01-17 08:21:12 +00:00
parent 9a36f8aadb
commit e82dc6935b

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -38,7 +38,8 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
@run main bug8078268
*/
public class bug8078268 {
private static final long TIMEOUT = 10_000;
private static final float tf = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0"));
private static final long TIMEOUT = 10_000 * (long)tf;
private static final String FILENAME = "slowparse.html";
@ -61,7 +62,7 @@ public class bug8078268 {
});
if (!latch.await(TIMEOUT, MILLISECONDS)) {
throw new RuntimeException("Parsing takes too long.");
throw new RuntimeException("Parsing takes too long. Current timeout is " + TIMEOUT);
}
if (exception != null) {
throw exception;