@@ -1214,24 +1214,34 @@ public void verifyManagedServersRestarted() throws Exception {
1214
1214
podNameSet .add (managedServerNameBase + i );
1215
1215
}
1216
1216
1217
- // Loop until all the servers have recycled
1217
+ // Loop until all the servers have recycled. Wait 5 minutes max for a managed server to be terminating.
1218
1218
//
1219
+ final int MAX_TERMINATE_LOOP = 300 ;
1220
+ int terminateLoopCount = 0 ;
1219
1221
while (podNameSet .size () > 0 ) {
1220
1222
Iterator <String > iter = podNameSet .iterator ();
1221
1223
while (iter .hasNext ()) {
1222
1224
String podName = iter .next ();
1223
1225
if (TestUtils .checkPodTerminatingNoWait (domainUid + "-" + podName , domainNS )) {
1226
+ terminateLoopCount = 0 ;
1227
+
1224
1228
// Server is terminating, wait until server running then remove it from the list
1225
- logger .info ("Managed server pod " + podName + " is terminating" );
1229
+ logger .info ("Managed managed server pod " + podName + " is terminating, waiting until it is re-created and running. " );
1226
1230
TestUtils .checkPodCreated (domainUid + "-" + podName , domainNS );
1231
+
1232
+ logger .info ("Waiting until managed server pod " + podName + " is ready" );
1227
1233
TestUtils .checkPodReady (domainUid + "-" + podName , domainNS );
1234
+
1228
1235
logger .info ("Managed server pod " + podName + " has been recycled" );
1229
1236
iter .remove ();
1230
1237
}
1231
1238
}
1232
1239
// We iterated through all the servers and if there are some remaining then
1233
1240
// Sleep and loop through the remaining ones again. Keep the sleep short so we don't miss the terminating status.
1234
1241
if (podNameSet .size () > 0 ) {
1242
+ if (++terminateLoopCount > MAX_TERMINATE_LOOP ) {
1243
+ throw new RuntimeException ("Timeout waiting for any managed server to terminate" );
1244
+ }
1235
1245
logger .info ("Waiting for any managed server pod to be terminating..." );
1236
1246
Thread .sleep (1000 );
1237
1247
}
0 commit comments