Skip to content

Commit 99bfafc

Browse files
committed
few fixes
1 parent 61647da commit 99bfafc

File tree

2 files changed

+35
-21
lines changed

2 files changed

+35
-21
lines changed

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

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -393,20 +393,24 @@ public void testDeleteOneDomain() throws Exception {
393393
operatorForDel1 = TestUtils.createOperator(opForDelYamlFile1);
394394
}
395395
Domain domain = null;
396-
boolean testCompletedSuccessfully = false;
397396
try {
398397
domain = testDomainCreation(domain1ForDelValueYamlFile);
399398
domain.verifyDomainCreated();
400399
TestUtils.verifyBeforeDeletion(domain);
400+
} catch (Exception ex) {
401+
if (domain != null && JENKINS) {
402+
try {
403+
domain.destroy();
404+
} catch (Exception ignore) {
405+
}
406+
}
407+
throw ex;
408+
}
401409

402-
logger.info("About to delete domain: " + domain.getDomainUid());
403-
TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
410+
logger.info("About to delete domain: " + domain.getDomainUid());
411+
TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
404412

405-
TestUtils.verifyAfterDeletion(domain);
406-
testCompletedSuccessfully = true;
407-
} finally {
408-
if (domain != null && (JENKINS || testCompletedSuccessfully)) domain.destroy();
409-
}
413+
TestUtils.verifyAfterDeletion(domain);
410414
logger.info("SUCCESS - testDeleteOneDomain");
411415
}
412416

@@ -420,7 +424,7 @@ public void testDeleteTwoDomains() throws Exception {
420424
operatorForDel2 = TestUtils.createOperator(opForDelYamlFile2);
421425
}
422426
Domain domainDel1 = null, domainDel2 = null;
423-
boolean testCompletedSuccessfully = false;
427+
424428
try {
425429
domainDel1 = testDomainCreation(domain2ForDelValueYamlFile);
426430
domainDel1.verifyDomainCreated();
@@ -429,19 +433,29 @@ public void testDeleteTwoDomains() throws Exception {
429433

430434
TestUtils.verifyBeforeDeletion(domainDel1);
431435
TestUtils.verifyBeforeDeletion(domainDel2);
436+
} catch (Exception ex) {
432437

433-
final String domainUidsToBeDeleted =
434-
domainDel1.getDomainUid() + "," + domainDel2.getDomainUid();
435-
logger.info("About to delete domains: " + domainUidsToBeDeleted);
436-
TestUtils.deleteWeblogicDomainResources(domainUidsToBeDeleted);
437-
438-
TestUtils.verifyAfterDeletion(domainDel1);
439-
TestUtils.verifyAfterDeletion(domainDel2);
440-
testCompletedSuccessfully = true;
441-
} finally {
442-
if (domainDel1 != null && (JENKINS || testCompletedSuccessfully)) domainDel1.destroy();
443-
if (domainDel2 != null && (JENKINS || testCompletedSuccessfully)) domainDel2.destroy();
438+
if (domainDel1 != null && JENKINS) {
439+
try {
440+
domainDel1.destroy();
441+
} catch (Exception ignore) {
442+
}
443+
}
444+
if (domainDel2 != null && JENKINS) {
445+
try {
446+
domainDel2.destroy();
447+
} catch (Exception ignore) {
448+
}
449+
}
450+
throw ex;
444451
}
452+
final String domainUidsToBeDeleted =
453+
domainDel1.getDomainUid() + "," + domainDel2.getDomainUid();
454+
logger.info("About to delete domains: " + domainUidsToBeDeleted);
455+
TestUtils.deleteWeblogicDomainResources(domainUidsToBeDeleted);
456+
457+
TestUtils.verifyAfterDeletion(domainDel1);
458+
TestUtils.verifyAfterDeletion(domainDel2);
445459
logger.info("SUCCESS - testDeleteTwoDomains");
446460
}
447461

integration-tests/src/test/resources/OperatorIT.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ baseDir=/scratch
55
#wls admin user
66
username=weblogic
77
password=welcome1
8-
maxIterationsPod=50
8+
maxIterationsPod=25
99
waitTimePod=10

0 commit comments

Comments
 (0)