8327505: Test com/sun/jmx/remote/NotificationMarshalVersions/TestSerializationMismatch.java fails

Reviewed-by: lmesnik, stuefe
This commit is contained in:
Kevin Walls 2024-03-28 09:06:41 +00:00
parent 47f33a59ea
commit 2b79c22c43

View File

@ -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.JMXConnectorFactory;
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 class Client {
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 class Client {
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);
}
}
}