|
68 | 68 | import static oracle.weblogic.kubernetes.utils.ClusterUtils.addClusterToDomain;
|
69 | 69 | import static oracle.weblogic.kubernetes.utils.ClusterUtils.createClusterAndVerify;
|
70 | 70 | import static oracle.weblogic.kubernetes.utils.ClusterUtils.createClusterResource;
|
| 71 | +import static oracle.weblogic.kubernetes.utils.ClusterUtils.removeReplicasSettingAndVerify; |
71 | 72 | import static oracle.weblogic.kubernetes.utils.ClusterUtils.scaleCluster;
|
72 | 73 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
|
73 | 74 | import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
|
@@ -413,17 +414,20 @@ void testDomainK8sEventsScalePastMaxWithoutChangingIntrospectVersion() {
|
413 | 414 | void testDomainK8sEventsScalePastMaxAndChangeIntrospectVersion() {
|
414 | 415 | OffsetDateTime timestamp = now();
|
415 | 416 | try {
|
416 |
| - logger.info("Scaling cluster using patching"); |
| 417 | + removeReplicasSettingAndVerify(domainUid, cluster1Name, domainNamespace3, replicaCount, |
| 418 | + managedServerPodNamePrefix); |
| 419 | + |
417 | 420 | String introspectVersion = assertDoesNotThrow(() -> getNextIntrospectVersion(domainUid, domainNamespace3));
|
418 |
| - assertFalse(scaleCluster(cluster1Name, domainNamespace3, 3), "failed to scale cluster via patching"); |
419 | 421 | String patchStr
|
420 | 422 | = "["
|
421 |
| - + "{\"op\": \"replace\", \"path\": \"/spec/introspectVersion\", \"value\": \"" + introspectVersion + "\"}" |
| 423 | + + "{\"op\": \"replace\", \"path\": \"/spec/introspectVersion\", \"value\": \"" + introspectVersion + "\"}," |
| 424 | + + "{\"op\": \"replace\", \"path\": \"/spec/replicas\", \"value\": 3}" |
422 | 425 | + "]";
|
423 | 426 |
|
424 | 427 | logger.info("Updating introspect version using patch string: {0}", patchStr);
|
425 | 428 | assertTrue(patchDomainCustomResource(domainUid, domainNamespace3, new V1Patch(patchStr),
|
426 |
| - V1Patch.PATCH_FORMAT_JSON_PATCH), "Patch domain failed"); |
| 429 | + V1Patch.PATCH_FORMAT_JSON_PATCH), "Patch domain did not fail as expected"); |
| 430 | + |
427 | 431 |
|
428 | 432 | logger.info("verify the Failed event is generated");
|
429 | 433 | checkFailedEvent(opNamespace, domainNamespace3, domainUid, REPLICAS_TOO_HIGH_ERROR, "Warning", timestamp);
|
|
0 commit comments