|
1 | 1 | /* |
2 | | - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
27 | 27 | * @summary Test that the initial derived gauge is (Integer)0 |
28 | 28 | * @author Daniel Fuchs |
29 | 29 | * |
| 30 | + * @library /test/lib |
| 31 | + * |
30 | 32 | * @run clean DerivedGaugeMonitorTest |
31 | 33 | * @run build DerivedGaugeMonitorTest |
32 | 34 | * @run main DerivedGaugeMonitorTest |
|
40 | 42 | import javax.management.ObjectName; |
41 | 43 | import javax.management.monitor.CounterMonitor; |
42 | 44 | import javax.management.monitor.GaugeMonitor; |
| 45 | +import jdk.test.lib.Utils; |
43 | 46 |
|
44 | 47 | public class DerivedGaugeMonitorTest { |
45 | 48 |
|
| 49 | + public static final int WAIT_TIME = 1000; |
| 50 | + |
46 | 51 | public static interface Things { |
47 | 52 | public long getALong(); |
48 | 53 | public int getAnInt(); |
@@ -239,7 +244,7 @@ public static void test(String attr) throws Exception { |
239 | 244 | mon1.setGranularityPeriod(5); |
240 | 245 | mon2.setGranularityPeriod(5); |
241 | 246 |
|
242 | | - my.cdl.await(1000, TimeUnit.MILLISECONDS); |
| 247 | + my.cdl.await(Utils.adjustTimeout(WAIT_TIME), TimeUnit.MILLISECONDS); |
243 | 248 | if (my.cdl.getCount() > 0) |
244 | 249 | throw new Exception(attr+": Count down not reached!"); |
245 | 250 |
|
|
0 commit comments