integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java
public void verifyManagedServersRestarted() throws Exception {
    if (!serverStartPolicy.equals("ADMIN_ONLY")) {

      // Note: Managed Servers can be stopped in any order.  Build the set of server names
      // then loop until all servers have been recycled.  When we find one that is terminating,
      // wait until it is running then remove it from the set.
      Set<String> podNameSet = new HashSet<>();
      for (int i = 1; i <= initialManagedServerReplicas; i++) {
        podNameSet.add(managedServerNameBase + i);
      }

      /* Loop until all the servers have recycled.  Wait 5 minutes max for a managed server
      to be terminating.*/
      final int maxTerminateLoop = 300;
      int terminateLoopCount = 0;
      while (podNameSet.size() > 0) {
        Iterator<String> iter = podNameSet.iterator();
        while (iter.hasNext()) {
          String podName = iter.next();
          if (TestUtils.checkPodTerminatingNoWait(domainUid + "-" + podName, domainNS)) {
            terminateLoopCount = 0;

            // Server is terminating, wait until server running then remove it from the list
            LoggerHelper.getLocal().log(Level.INFO, "Managed managed server pod " + podName
                + "  is terminating, waiting until it is re-created and running.");
            TestUtils.checkPodCreated(domainUid + "-" + podName, domainNS);

            LoggerHelper.getLocal().log(
                Level.INFO, "Waiting until managed server pod " + podName + "  is ready");
            TestUtils.checkPodReady(domainUid + "-" + podName, domainNS);

            LoggerHelper.getLocal().log(
                Level.INFO, "Managed server pod " + podName + " has been recycled");
            iter.remove();
          }
        }
        // We iterated through all the servers and if there are some remaining then
        // Sleep and loop through the remaining ones again.
        // Keep the sleep short so we don't miss the terminating status.
        if (podNameSet.size() > 0) {
          if (++terminateLoopCount > maxTerminateLoop) {
            throw new RuntimeException("Timeout waiting for any managed server to terminate");
          }
          LoggerHelper.getLocal().log(
              Level.INFO, "Waiting for any managed server pod to be terminating...");
          Thread.sleep(1000);
        }
      }
    }
  }
/**
   * Verify that managed server pods get restarted.
   *
   * @throws Exception if failed to verify managed server to restart
   */
Verify that managed server pods get restarted.
@throws Exception if failed to verify managed server to restart
Verify that managed server pods get restarted . @throws Exception if failed to verify managed server to restart
public void verifyManagedServersRestarted() throws Exception {
    if (!serverStartPolicy.equals("ADMIN_ONLY")) {
      Set<String> podNameSet = new HashSet<>();
      for (int i = 1; i <= initialManagedServerReplicas; i++) {
        podNameSet.add(managedServerNameBase + i);
      }
      /* Loop until all the servers have recycled.  Wait 5 minutes max for a managed server
      to be terminating.*/
      final int maxTerminateLoop = 300;
      int terminateLoopCount = 0;
      while (podNameSet.size() > 0) {
        Iterator<String> iter = podNameSet.iterator();
        while (iter.hasNext()) {
          String podName = iter.next();
          if (TestUtils.checkPodTerminatingNoWait(domainUid + "-" + podName, domainNS)) {
            terminateLoopCount = 0;
            LoggerHelper.getLocal().log(Level.INFO, "Managed managed server pod " + podName
                + "  is terminating, waiting until it is re-created and running.");
            TestUtils.checkPodCreated(domainUid + "-" + podName, domainNS);
            LoggerHelper.getLocal().log(
                Level.INFO, "Waiting until managed server pod " + podName + "  is ready");
            TestUtils.checkPodReady(domainUid + "-" + podName, domainNS);
            LoggerHelper.getLocal().log(
                Level.INFO, "Managed server pod " + podName + " has been recycled");
            iter.remove();
          }
        }
        if (podNameSet.size() > 0) {
          if (++terminateLoopCount > maxTerminateLoop) {
            throw new RuntimeException("Timeout waiting for any managed server to terminate");
          }
          LoggerHelper.getLocal().log(
              Level.INFO, "Waiting for any managed server pod to be terminating...");
          Thread.sleep(1000);
        }
      }
    }
  }
public void verifyManagedServersRestarted ( ) throws Exception { if ( ! serverStartPolicy . equals ( "ADMIN_ONLY" ) ) { Set < String > podNameSet = new HashSet < > ( ) ; for ( int i = 1 ; i <= initialManagedServerReplicas ; i ++ ) { podNameSet . add ( managedServerNameBase + i ) ; } /* Loop until all the servers have recycled.  Wait 5 minutes max for a managed server
      to be terminating.*/ final int maxTerminateLoop = 300 ; int terminateLoopCount = 0 ; while ( podNameSet . size ( ) > 0 ) { Iterator < String > iter = podNameSet . iterator ( ) ; while ( iter . hasNext ( ) ) { String podName = iter . next ( ) ; if ( TestUtils . checkPodTerminatingNoWait ( domainUid + "-" + podName , domainNS ) ) { terminateLoopCount = 0 ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Managed managed server pod " + podName + "  is terminating, waiting until it is re-created and running." ) ; TestUtils . checkPodCreated ( domainUid + "-" + podName , domainNS ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Waiting until managed server pod " + podName + "  is ready" ) ; TestUtils . checkPodReady ( domainUid + "-" + podName , domainNS ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Managed server pod " + podName + " has been recycled" ) ; iter . remove ( ) ; } } if ( podNameSet . size ( ) > 0 ) { if ( ++ terminateLoopCount > maxTerminateLoop ) { throw new RuntimeException ( "Timeout waiting for any managed server to terminate" ) ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "Waiting for any managed server pod to be terminating..." ) ; Thread . sleep ( 1000 ) ; } } } }
Verify that managed server pods get restarted.
Verify that managed server pods get restarted .
// Note: Managed Servers can be stopped in any order.  Build the set of server names // then loop until all servers have been recycled.  When we find one that is terminating, // wait until it is running then remove it from the set. // Server is terminating, wait until server running then remove it from the list // We iterated through all the servers and if there are some remaining then // Sleep and loop through the remaining ones again. // Keep the sleep short so we don't miss the terminating status.