Skip to content

Commit 2e2d304

Browse files
authored
OWLS-105640: [wko-nightly] ServerStartPolicyUtils.scalingClusters failed for both ItServerStartPolicyConfigCluster and ItServerStartPolicyDynamicCluster (#3833)
* update regex for validating clusterStatus.sh result
1 parent 06a51e1 commit 2e2d304

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItServerStartPolicyConfigCluster.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -389,24 +389,25 @@ void testConfigClusterScale() {
389389

390390
// use clusterStatus.sh to make sure the server-to-be-test doesn't exist
391391
// String regex matches below
392-
// cluster min max goal current ready
393-
// clusterName 0 5 1 1 1
394-
String regex = ".*" + DYNAMIC_CLUSTER + "(\\s+)0(\\s+)5(\\s+)1(\\s+)1(\\s+)1";
392+
// cluster status available min max goal current ready
393+
// clusterName Completed True 0 5 1 1 1
394+
String regex =
395+
".*" + DYNAMIC_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)5(\\s+)1(\\s+)1(\\s+)1";
395396
scalingClusters(domainUid, domainNamespace, DYNAMIC_CLUSTER, dynamicServerPodName,
396397
replicaCount, regex, false, samplePath);
397398
// String regex matches below
398-
// cluster min max goal current ready
399-
// clusterName 0 2 1 1 1
400-
regex = ".*" + CONFIG_CLUSTER + "(\\s+)0(\\s+)2(\\s+)1(\\s+)1(\\s+)1";
399+
// cluster status available min max goal current ready
400+
// clusterName Completed True 0 2 1 1 1
401+
regex = ".*" + CONFIG_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)2(\\s+)1(\\s+)1(\\s+)1";
401402
scalingClusters(domainUid, domainNamespace, CONFIG_CLUSTER, configServerPodName,
402403
replicaCount, regex, false, samplePath);
403404

404405
// use scaleCluster.sh to scale a dynamic cluster and
405406
// use clusterStatus.sh to verify scaling results
406407
// String regex matches below
407-
// cluster min max goal current ready
408-
// clusterName 0 2 2 2 2
409-
regex = ".*" + CONFIG_CLUSTER + "(\\s+)0(\\s+)2(\\s+)2(\\s+)2(\\s+)2";
408+
// cluster status available min max goal current ready
409+
// clusterName Completed True 0 2 2 2 2
410+
regex = ".*" + CONFIG_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)2(\\s+)2(\\s+)2(\\s+)2";
410411
scalingClusters(domainUid, domainNamespace, CONFIG_CLUSTER,
411412
configServerPodName, newReplicaCount, regex, true, samplePath);
412413

@@ -418,9 +419,9 @@ void testConfigClusterScale() {
418419

419420
// use clusterStatus.sh to restore test env
420421
// String regex matches below
421-
// cluster min max goal current ready
422-
// clusterName 0 2 1 1 1
423-
regex = ".*" + CONFIG_CLUSTER + "(\\s+)0(\\s+)2(\\s+)1(\\s+)1(\\s+)1";
422+
// cluster status available min max goal current ready
423+
// clusterName Completed True 0 2 1 1 1
424+
regex = ".*" + CONFIG_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)2(\\s+)1(\\s+)1(\\s+)1";
424425
scalingClusters(domainUid, domainNamespace, CONFIG_CLUSTER, configServerPodName,
425426
replicaCount, regex, false, samplePath);
426427
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItServerStartPolicyDynamicCluster.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -527,24 +527,25 @@ void testDynamicClusterScale() {
527527

528528
// use clusterStatus.sh to make sure the server-to-be-test doesn't exist
529529
// String regex matches below
530-
// cluster min max goal current ready
531-
// clusterName 0 5 1 1 1
532-
String regex = ".*" + DYNAMIC_CLUSTER + "(\\s+)0(\\s+)5(\\s+)1(\\s+)1(\\s+)1";
530+
// cluster status available min max goal current ready
531+
// clusterName Completed True 0 5 1 1 1
532+
String regex =
533+
".*" + DYNAMIC_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)5(\\s+)1(\\s+)1(\\s+)1";
533534
scalingClusters(domainUid, domainNamespace, DYNAMIC_CLUSTER,
534535
dynamicServerPodName, replicaCount, regex, false, samplePath);
535536
// String regex matches below
536-
// cluster min max goal current ready
537-
// clusterName 0 2 1 1 1
538-
regex = ".*" + CONFIG_CLUSTER + "(\\s+)0(\\s+)2(\\s+)1(\\s+)1(\\s+)1";
537+
// cluster status available min max goal current ready
538+
// clusterName Completed True 0 2 1 1 1
539+
regex = ".*" + CONFIG_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)2(\\s+)1(\\s+)1(\\s+)1";
539540
scalingClusters(domainUid, domainNamespace, configuredClusterResourceName, configServerPodName,
540541
replicaCount, regex, false, samplePath);
541542

542543
// use scaleCluster.sh to scale a dynamic cluster and
543544
// use clusterStatus.sh to verify scaling results
544545
// String regex matches below
545-
// cluster min max goal current ready
546-
// clusterName 0 5 2 2 2
547-
regex = ".*" + DYNAMIC_CLUSTER + "(\\s+)0(\\s+)5(\\s+)2(\\s+)2(\\s+)2";
546+
// cluster status available min max goal current ready
547+
// clusterName Completed True 0 5 2 2 2
548+
regex = ".*" + DYNAMIC_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)5(\\s+)2(\\s+)2(\\s+)2";
548549
scalingClusters(domainUid, domainNamespace, DYNAMIC_CLUSTER,
549550
dynamicServerPodName, newReplicaCount, regex, true, samplePath);
550551

@@ -556,9 +557,9 @@ void testDynamicClusterScale() {
556557

557558
// use clusterStatus.sh to restore test env
558559
// String regex matches below
559-
// cluster min max goal current ready
560-
// clusterName 0 5 1 1 1
561-
regex = ".*" + DYNAMIC_CLUSTER + "(\\s+)0(\\s+)5(\\s+)1(\\s+)1(\\s+)1";
560+
// cluster status available min max goal current ready
561+
// clusterName Completed True 0 5 1 1 1
562+
regex = ".*" + DYNAMIC_CLUSTER + "(\\s+)Completed(\\s+)True(\\s+)0(\\s+)5(\\s+)1(\\s+)1(\\s+)1";
562563
scalingClusters(domainUid, domainNamespace,DYNAMIC_CLUSTER, dynamicServerPodName,
563564
replicaCount, regex, false, samplePath);
564565
}

0 commit comments

Comments
 (0)