From d7ceb51bb3a108e557f50998a539bf46ec510bf8 Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Thu, 16 Jun 2016 11:29:42 -0700 Subject: For deadlock test, print out any unexpected exceptions. Bug: 28663029 Change-Id: Icd10cabdde282f292fd997c3a8ad9dd6d1a14e0e --- test/033-class-init-deadlock/src/Main.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/033-class-init-deadlock/src/Main.java b/test/033-class-init-deadlock/src/Main.java index 3346aa6813..bd4d4ab7b5 100644 --- a/test/033-class-init-deadlock/src/Main.java +++ b/test/033-class-init-deadlock/src/Main.java @@ -36,7 +36,8 @@ public class Main { thread1.start(); thread2.start(); - try { barrier.await(); } catch (Exception e) { } + // Not expecting any exceptions, so print them out if we get them. + try { barrier.await(); } catch (Exception e) { System.out.println(e); } try { Thread.sleep(6000); } catch (InterruptedException ie) { } System.out.println("Deadlock test interrupting threads."); @@ -51,7 +52,8 @@ public class Main { class A { static { - try { Main.barrier.await(); } catch (Exception e) { } + // Not expecting any exceptions, so print them out if we get them. + try { Main.barrier.await(); } catch (Exception e) { System.out.println(e); } new B(); System.out.println("A initialized"); Main.aInitialized = true; @@ -60,7 +62,8 @@ class A { class B { static { - try { Main.barrier.await(); } catch (Exception e) { } + // Not expecting any exceptions, so print them out if we get them. + try { Main.barrier.await(); } catch (Exception e) { System.out.println(e); } new A(); System.out.println("B initialized"); Main.bInitialized = true; -- cgit v1.2.3-59-g8ed1b