@@ -267,7 +267,7 @@ void testDeleteOperatorButNotDomain() {
267267
268268 // delete operator
269269 logger .info ("Uninstalling operator" );
270- uninstallOperator (opHelmParams );
270+ uninstallOperatorAndVerify (opHelmParams );
271271 cleanUpSA (opNamespace );
272272 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , opNamespace );
273273
@@ -349,7 +349,7 @@ void testCreateDeleteCreateOperatorButNotDomain() {
349349 }
350350 // delete operator
351351 logger .info ("Uninstalling operator" );
352- uninstallOperator (opHelmParams );
352+ uninstallOperatorAndVerify (opHelmParams );
353353
354354 //install second time
355355 opHelmParams = installOperatorHelmChart (opNamespace , opServiceAccount , false , true , false ,
@@ -375,7 +375,7 @@ void testCreateDeleteCreateOperatorButNotDomain() {
375375 logger .info ("Domain1 scaled to " + replicaCountDomain1 + " servers" );
376376
377377 } finally {
378- uninstallOperator (op1HelmParams );
378+ uninstallOperatorAndVerify (op1HelmParams );
379379 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , opNamespace );
380380 cleanUpSA (opNamespace );
381381 if (!isDomain1Running ) {
@@ -490,7 +490,7 @@ void testAddRemoveDomainNameSpacesOnOperator() {
490490 "operator can still manage domain3, scaling was succeeded for " + managedServerPodName1 );
491491
492492 } finally {
493- uninstallOperator (op1HelmParams );
493+ uninstallOperatorAndVerify (op1HelmParams );
494494 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , op2Namespace );
495495 cleanUpSA (op2Namespace );
496496 if (!isDomain2Running ) {
@@ -534,8 +534,8 @@ void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() {
534534 assertNull (opHelmParam2 ,
535535 "FAILURE: Helm installs operator in the same namespace as first operator installed " );
536536 } finally {
537- uninstallOperator (opHelmParams );
538- uninstallOperator (op2HelmParams );
537+ uninstallOperatorAndVerify (opHelmParams );
538+ uninstallOperatorAndVerify (op2HelmParams );
539539 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , opNamespace );
540540 cleanUpSA (opNamespace );
541541 if (!isDomain1Running ) {
@@ -579,8 +579,8 @@ void testSecondOpSharingSameDomainNamespacesNegativeInstall() {
579579 expectedError ,"failed" , 0 , op2HelmParams , LIST_STRATEGY , domain2Namespace );
580580 assertNull (opHelmParam2 , "FAILURE: Helm installs operator in the same namespace as first operator installed " );
581581 } finally {
582- uninstallOperator (opHelmParams );
583- uninstallOperator (op2HelmParams );
582+ uninstallOperatorAndVerify (opHelmParams );
583+ uninstallOperatorAndVerify (op2HelmParams );
584584 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , opNamespace );
585585 cleanUpSA (opNamespace );
586586 cleanUpSA (op2Namespace );
@@ -627,9 +627,9 @@ void testSecondOpSharingSameExternalRestPortNegativeInstall() {
627627 expectedError ,"failed" ,
628628 externalRestHttpsPort , op2HelmParams , LIST_STRATEGY , domain2Namespace );
629629 assertNull (opHelmParam2 , "FAILURE: Helm installs operator in the same namespace as first operator installed " );
630- uninstallOperator (op2HelmParams );
630+ uninstallOperatorAndVerify (op2HelmParams );
631631 } finally {
632- uninstallOperator (opHelmParams );
632+ uninstallOperatorAndVerify (opHelmParams );
633633 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , opNamespace );
634634 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , op2Namespace );
635635 cleanUpSA (opNamespace );
@@ -660,7 +660,7 @@ void testNotPreCreatedOpNsCreateOperatorNegativeInstall() {
660660 LIST_STRATEGY , domain2Namespace );
661661 assertNull (opHelmParam2 , "FAILURE: Helm installs operator in the same namespace as first operator installed " );
662662 } finally {
663- uninstallOperator (op2HelmParams );
663+ uninstallOperatorAndVerify (op2HelmParams );
664664 }
665665 }
666666
@@ -727,7 +727,7 @@ void testCreateWithEmptyDomainNamespaceInstall() {
727727 --replicaCountDomain2 ;
728728 logger .info ("Domain2 scaled to " + replicaCountDomain2 + " servers" );
729729 } finally {
730- uninstallOperator (op2HelmParams );
730+ uninstallOperatorAndVerify (op2HelmParams );
731731 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , op2Namespace );
732732 cleanUpSA (op2Namespace );
733733 if (!isDomain2Running ) {
@@ -802,7 +802,7 @@ void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() {
802802 assertNotNull (errorMsg , "Expected error message for missing ServiceAccount not found" );
803803 } finally {
804804 //uninstall operator helm chart
805- uninstallOperator (opHelmParams );
805+ uninstallOperatorAndVerify (opHelmParams );
806806 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , op2Namespace );
807807 cleanUpSA (op2Namespace );
808808 }
@@ -904,7 +904,7 @@ void testTwoDomainsInSameNameSpaceOnOperator() {
904904 } catch (Exception ex ) {
905905 logger .info ("Failed to collect operator log" );
906906 }
907- uninstallOperator (op1HelmParams );
907+ uninstallOperatorAndVerify (op1HelmParams );
908908 deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , op3Namespace );
909909 cleanUpSA (op3Namespace );
910910 }
@@ -1295,4 +1295,17 @@ private void cleanUpDomainSecrets(String domainNamespace) {
12951295 }
12961296 }
12971297 }
1298+
1299+ private void uninstallOperatorAndVerify (HelmParams opHelmParams ) {
1300+
1301+ logger .info ("Uninstalling operator" );
1302+ uninstallOperator (opHelmParams );
1303+
1304+ String opNamespace = opHelmParams .getNamespace ();
1305+ // check the operator pod deleted
1306+ String operatorPodName = assertDoesNotThrow (() -> getOperatorPodName (OPERATOR_RELEASE_NAME , opNamespace ),
1307+ "Can't get operator's pod name" );
1308+ checkPodDoesNotExist (operatorPodName , null , opNamespace );
1309+
1310+ }
12981311}
0 commit comments