Skip to content

Commit

Permalink
8300205: Swing test bug8078268 make latch timeout configurable
Browse files Browse the repository at this point in the history
Backport-of: e82dc6935b5f575a53fcba9c96767cee1b535cb8
  • Loading branch information
MBaesken committed Feb 14, 2023
1 parent 17084d5 commit 8b30968
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -38,7 +38,8 @@
@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";

Expand All @@ -61,7 +62,7 @@ public void run() {
});

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;
Expand Down

1 comment on commit 8b30968

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.