--- old/test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexResetUpdate.java 2019-01-24 12:28:21.000000000 +0000 +++ new/test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/HandlersOnComplexResetUpdate.java 2019-01-24 12:28:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -217,7 +217,7 @@ barChild = null; while ((ref2 = queue.poll()) == null) { System.gc(); - Thread.sleep(100); + Thread.sleep(1000); if (--max == 0) break; } @@ -328,21 +328,25 @@ throw new RuntimeException(x); } }); - fooChild = null; - System.out.println("Setting fooChild to: " + fooChild); - while ((ref2 = queue.poll()) == null) { - System.gc(); - Thread.sleep(1000); - } - if (ref2 != fooRef) { - throw new RuntimeException("Unexpected reference: " - + ref2 +"\n\texpected: " + fooRef); - } - if (ref2.get() != null) { - throw new RuntimeException("Referent not cleared: " + ref2.get()); - } - System.out.println("Got fooRef after reset(), fooChild is " + fooChild); - + try { + fooChild = null; + System.out.println("Setting fooChild to: " + fooChild); + while ((ref2 = queue.poll()) == null) { + System.gc(); + Thread.sleep(1000); + } + if (ref2 != fooRef) { + throw new RuntimeException("Unexpected reference: " + + ref2 +"\n\texpected: " + fooRef); + } + if (ref2.get() != null) { + throw new RuntimeException("Referent not cleared: " + ref2.get()); + } + System.out.println("Got fooRef after reset(), fooChild is " + fooChild); + } catch(Throwable t) { + if (failed != null) t.addSuppressed(failed); + throw t; + } } if (failed != null) { // should rarely happen...