Skip to content

Commit 97a8905

Browse files
committed
Update kubernetes client to 5.4.1 and fix unit tests
1 parent e09d6cb commit 97a8905

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

zeppelin-plugins/launcher/k8s-standard/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
<properties>
3737
<plugin.name>Launcher/K8sStandardInterpreterLauncher</plugin.name>
38-
<kubernetes.client.version>5.3.2</kubernetes.client.version>
38+
<kubernetes.client.version>5.4.1</kubernetes.client.version>
3939
<jinjava.version>2.5.4</jinjava.version>
4040
</properties>
4141

zeppelin-plugins/launcher/k8s-standard/src/test/java/org/apache/zeppelin/interpreter/launcher/K8sRemoteInterpreterProcessTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
public class K8sRemoteInterpreterProcessTest {
4747

4848
@Rule
49-
public KubernetesServer server = new KubernetesServer(false, true);
49+
public KubernetesServer server = new KubernetesServer(true, true);
5050

5151
@Test
5252
public void testPredefinedPortNumbers() {

zeppelin-plugins/launcher/k8s-standard/src/test/java/org/apache/zeppelin/interpreter/launcher/PodPhaseWatcherTest.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.concurrent.TimeUnit;
2424

2525
import org.apache.commons.lang3.StringUtils;
26-
import org.junit.Ignore;
2726
import org.junit.Rule;
2827
import org.junit.Test;
2928

@@ -39,10 +38,9 @@
3938
public class PodPhaseWatcherTest {
4039

4140
@Rule
42-
public KubernetesServer server = new KubernetesServer(false, true);
41+
public KubernetesServer server = new KubernetesServer(true, true);
4342

4443
@Test
45-
@Ignore("Reamer - ZEPPELIN-5403")
4644
public void testPhase() throws InterruptedException {
4745
KubernetesClient client = server.getClient();
4846
// CREATE
@@ -56,24 +54,25 @@ public void testPhase() throws InterruptedException {
5654
// WATCH
5755
PodPhaseWatcher podWatcher = new PodPhaseWatcher(
5856
phase -> StringUtils.equalsAnyIgnoreCase(phase, "Succeeded", "Failed", "Running"));
59-
Watch watch = client.pods().inNamespace("ns1").withName("pod1").watch(podWatcher);
57+
try (Watch watch = client.pods().inNamespace("ns1").withName("pod1").watch(podWatcher)) {
6058

61-
// Update Pod to "pending" phase
62-
pod.setStatus(new PodStatus(null, null, null, null, null, null, null, "Pending", null, null,
63-
null, null, null));
64-
client.pods().inNamespace("ns1").updateStatus(pod);
59+
// Update Pod to "pending" phase
60+
pod.setStatus(new PodStatus(null, null, null, null, null, null, null, "Pending", null, null,
61+
null, null, null));
62+
pod = client.pods().inNamespace("ns1").updateStatus(pod);
6563

66-
// Update Pod to "Running" phase
67-
pod.setStatus(new PodStatusBuilder(new PodStatus(null, null, null, null, null, null, null,
68-
"Running", null, null, null, null, null)).build());
69-
client.pods().inNamespace("ns1").updateStatus(pod);
64+
// Wait a little bit, till update is applied
65+
Thread.sleep(1000);
66+
// Update Pod to "Running" phase
67+
pod.setStatus(new PodStatusBuilder(new PodStatus(null, null, null, null, null, null, null,
68+
"Running", null, null, null, null, null)).build());
69+
client.pods().inNamespace("ns1").updateStatus(pod);
7070

71-
assertTrue(podWatcher.getCountDownLatch().await(1, TimeUnit.SECONDS));
72-
watch.close();
71+
assertTrue(podWatcher.getCountDownLatch().await(1, TimeUnit.SECONDS));
72+
}
7373
}
7474

7575
@Test
76-
@Ignore("Reamer - ZEPPELIN-5403")
7776
public void testPhaseWithError() throws InterruptedException {
7877
KubernetesClient client = server.getClient();
7978
// CREATE

0 commit comments

Comments
 (0)