Skip to content

Commit 2e300c1

Browse files
committed
Bug 35126384 - Build: management.MultiClusterInSingleProcessTests.xtestClusterNodeShutdownWithServicesRestart (14.1.1.0 -> ce-v14.1.1.0, 12.2.1.4 @99177)
[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.1.0/": change = 99183]
1 parent 9f53039 commit 2e300c1

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

prj/test/functional/management/src/test/java/management/shutdown/ManagementShutdownTests.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,32 @@ public void testClusterNodeShutdownWithServicesRestart()
208208
assertThat(listItemMaps.get(0).get("member"), is(memberName));
209209
assertThat(listItemMaps.get(0).get("running"), is(true));
210210

211+
target = getBaseTarget().path(SERVICES).path(HttpHelper.getServiceName()).path("members");
212+
response = target.request().get();
213+
assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));
214+
mapResponse = readEntity(target, response);
215+
listItemMaps = (List<Map>) mapResponse.get("items");
216+
assertThat(listItemMaps.size(), is(1));
217+
218+
String sNodeId = (String) listItemMaps.get(0).get("nodeId");
211219
CacheFactory.log("Shutting down " + memberName, CacheFactory.LOG_INFO);
212-
response = getBaseTarget().path("members").path(memberName).path("shutdown").request(MediaType.APPLICATION_JSON_TYPE).post(null);
213-
MatcherAssert.assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));
220+
try
221+
{
222+
response = getBaseTarget().path("members").path(SERVER_PREFIX + "-2").path("shutdown").request(MediaType.APPLICATION_JSON_TYPE).post(null);
223+
MatcherAssert.assertThat(response.getStatus(), is(Response.Status.OK.getStatusCode()));
224+
}
225+
catch (Exception e)
226+
{
227+
// Occasionally, it may get exception if the management HTTP service
228+
// is started on the node being shutdown;
229+
// In this case, it won't be able to connect to the REST service again;
230+
// log the exception and return.
231+
System.err.println("xtestClusterNodeShutdownWithServicesRestart() got an exception: " + e);
232+
if (sNodeId.equals("2"))
233+
{
234+
return;
235+
}
236+
}
214237

215238
AtomicReference<Response> serviceMemberResponse = new AtomicReference<>();
216239
WebTarget serviceMemberTarget = getBaseTarget().path(SERVICES).path(MetricsHttpHelper.getServiceName()).path("members");

0 commit comments

Comments
 (0)