Skip to content

Commit d90f618

Browse files
committed
re-enable another load balancing verification. Print services for debugging
1 parent 0ef067c commit d90f618

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ public void testClusterScaling(Operator operator, Domain domain) throws Exceptio
315315
+ replicas);
316316
}
317317

318+
// print services (TODO- only if failed)
319+
TestUtils.getServices(domainNS);
320+
318321
// commenting the load balance check, bug 29325139
319322
domain.verifyWebAppLoadBalancing(TESTWEBAPP);
320323

@@ -334,8 +337,12 @@ public void testClusterScaling(Operator operator, Domain domain) throws Exceptio
334337
+ "/"
335338
+ replicas);
336339
}
340+
// print services (TODO- only if failed)
341+
TestUtils.getServices(domainNS);
342+
337343
// commenting the load balance check, bug 29325139
338-
// domain.verifyWebAppLoadBalancing(TESTWEBAPP);
344+
domain.verifyWebAppLoadBalancing(TESTWEBAPP);
345+
339346
logger.info("Done - testClusterScaling");
340347
}
341348

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,7 @@ public static boolean checkHasServiceChannelPort(
239239
logger.info(" Find services in namespage " + namespace + " with command: '" + cmd + "'");
240240

241241
ExecResult result = ExecCommand.exec(cmd.toString());
242-
String stdout = result.stdout();
243-
logger.info(" Services found: ");
244-
logger.info(stdout);
242+
String stdout = getServices(namespace);
245243
String stdoutlines[] = stdout.split("\\r?\\n");
246244
if (result.exitValue() == 0 && stdoutlines.length > 0) {
247245
for (String stdoutline : stdoutlines) {
@@ -253,6 +251,18 @@ public static boolean checkHasServiceChannelPort(
253251
return false;
254252
}
255253

254+
public static String getServices(String namespace) throws Exception {
255+
StringBuffer cmd = new StringBuffer("kubectl get services ");
256+
cmd.append(" -n ").append(namespace);
257+
logger.info(" Find services in namespage " + namespace + " with command: '" + cmd + "'");
258+
259+
ExecResult result = ExecCommand.exec(cmd.toString());
260+
String stdout = result.stdout();
261+
logger.info(" Services found: ");
262+
logger.info(stdout);
263+
return stdout;
264+
}
265+
256266
/**
257267
* First, kill the mgd server process in the container three times to cause the node manager to
258268
* mark the server 'failed not restartable'. This in turn is detected by the liveness probe, which

0 commit comments

Comments
 (0)