From 5c802de1bc8a0a8cae6ec4011862607f76551c6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:45:16 +0000 Subject: [PATCH 1/2] Initial plan From 3411067f570b376237f0488806a43ac0fa1f5cf7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:48:50 +0000 Subject: [PATCH 2/2] Fix flaky CopyTest: wait for exec request instead of fixed sleep Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com> --- .../java/io/kubernetes/client/CopyTest.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/util/src/test/java/io/kubernetes/client/CopyTest.java b/util/src/test/java/io/kubernetes/client/CopyTest.java index f5f18c84ec..059b521cf1 100644 --- a/util/src/test/java/io/kubernetes/client/CopyTest.java +++ b/util/src/test/java/io/kubernetes/client/CopyTest.java @@ -131,6 +131,21 @@ void setup() { podName = "apod"; } + // Wait (bounded) until the exec request reaches the mock server, instead of a fixed sleep + // which is flaky on slow CI runners. + private void waitForExecRequest() throws InterruptedException { + long deadline = System.currentTimeMillis() + 30000; + while (System.currentTimeMillis() < deadline + && apiServer + .findAll( + getRequestedFor( + urlPathEqualTo( + "/api/v1/namespaces/" + namespace + "/pods/" + podName + "/exec"))) + .isEmpty()) { + Thread.sleep(100); + } + } + @Test void url() { Copy copy = new Copy(client); @@ -195,7 +210,7 @@ public void run() { } }); t.start(); - Thread.sleep(2000); + waitForExecRequest(); t.interrupt(); apiServer.verify( @@ -241,7 +256,7 @@ public void run() { } }); t.start(); - Thread.sleep(2000); + waitForExecRequest(); t.interrupt(); apiServer.verify( @@ -285,7 +300,7 @@ public void run() { } }); t.start(); - Thread.sleep(2000); + waitForExecRequest(); t.interrupt(); apiServer.verify(