Skip to content

Commit 1ca06a7

Browse files
committed
Make WLDF test predictable
Signed-off-by: doxiao <dongbo.xiao@oracle.com>
1 parent c6066b4 commit 1ca06a7

File tree

1 file changed

+13
-8
lines changed
  • integration-tests/src/test/java/oracle/kubernetes/operator

1 file changed

+13
-8
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -408,23 +408,28 @@ private void copyScalingScriptToPod(
408408

409409
private void callWebAppAndVerifyScaling(Domain domain, int replicas) throws Exception {
410410
Map<String, Object> domainMap = domain.getDomainMap();
411-
String domainNS = (String) domainMap.get("namespace");
411+
String domainNS = domainMap.get("namespace").toString();
412+
String domainUid = domain.getDomainUid();
413+
String clusterName = domainMap.get("clusterName").toString();
412414

413415
// call opensessionapp
414416
domain.callWebAppAndVerifyLoadBalancing("opensessionapp", false);
415417
logger.info("Sleeping for 30 seconds for scaleup");
416418
Thread.sleep(30 * 1000);
417419

420+
int replicaCntAfterScaleup = TestUtils.getClusterReplicas(domainUid, clusterName, domainNS);
418421
String managedServerNameBase = (String) domainMap.get("managedServerNameBase");
419-
String podName = domain.getDomainUid() + "-" + managedServerNameBase + replicas;
422+
for (int i = replicas; i <= replicaCntAfterScaleup; i++) {
423+
String podName = domain.getDomainUid() + "-" + managedServerNameBase + i;
420424

421-
logger.info("Checking if managed pod(" + podName + ") is Running");
422-
TestUtils.checkPodCreated(podName, domainNS);
425+
logger.info("Checking if managed pod(" + podName + ") is Running");
426+
TestUtils.checkPodCreated(podName, domainNS);
423427

424-
logger.info("Checking if managed server (" + podName + ") is Running");
425-
TestUtils.checkPodReady(podName, domainNS);
428+
logger.info("Checking if managed server (" + podName + ") is Running");
429+
TestUtils.checkPodReady(podName, domainNS);
426430

427-
logger.info("Checking if managed service(" + podName + ") is created");
428-
TestUtils.checkServiceCreated(podName, domainNS);
431+
logger.info("Checking if managed service(" + podName + ") is created");
432+
TestUtils.checkServiceCreated(podName, domainNS);
433+
}
429434
}
430435
}

0 commit comments

Comments
 (0)