From 2b79c22c43a2de0815e77c9aa71f010906be8670 Mon Sep 17 00:00:00 2001 From: Kevin Walls Date: Thu, 28 Mar 2024 09:06:41 +0000 Subject: [PATCH] 8327505: Test com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java fails Reviewed-by: lmesnik, stuefe --- .../NotificationMarshalVersions/Client/Client.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java b/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java index 384a08d177267..80931ca744061 100644 --- a/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java +++ b/test/jdk/com/sun/jmx/remote/NotificationMarshalVersions/Client/Client.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2024, 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 @@ -37,6 +37,9 @@ import javax.management.remote.JMXServiceURL; public class Client { + + public static final int COUNTER_TIMEOUT_SECONDS = 60; + public static void run(String url) throws Exception { final int notifEmittedCnt = 10; final CountDownLatch counter = new CountDownLatch(notifEmittedCnt); @@ -84,8 +87,8 @@ public void handleNotification(Notification notification, Object handback) { System.out.println(); try { System.out.println("waiting for " + notifEmittedCnt + " notifications to arrive"); - if (!counter.await(30, TimeUnit.SECONDS)) { - throw new InterruptedException(); + if (!counter.await(COUNTER_TIMEOUT_SECONDS, TimeUnit.SECONDS)) { + throw new Error("Client: Counter await expired"); } if (duplNotification.get()) { System.out.println("ERROR: received duplicated notifications"); @@ -94,7 +97,7 @@ public void handleNotification(Notification notification, Object handback) { System.out.println("\nshutting down client"); } catch (InterruptedException e) { System.out.println("ERROR: notification processing thread interrupted"); - throw new Error("notification thread interrupted unexpectedly"); + throw new Error("notification thread interrupted unexpectedly", e); } } }