Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing KubernetesPipelineTest.runWithSlaveConnectTimeout #506

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

jglick
Copy link
Member

@jglick jglick commented Jun 13, 2019

Removing a test added in #421 (and lightly edited in #447).

In #503 I saw that it had flaked, which I could reproduce as follows:

diff --git a/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java b/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java
index 4b88e385..1ff45bf7 100644
--- a/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java
+++ b/src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesPipelineTest.java
@@ -344,6 +344,7 @@ public class KubernetesPipelineTest extends AbstractKubernetesPipelineTest {
     public void runWithSlaveConnectTimeout() throws Exception {
         r.waitForMessage("podTemplate", b);
 
+        Thread.sleep(60_000);
         PodTemplate timeoutTemplate = cloud.getAllTemplates().stream().filter(x -> name.getMethodName().equals(x.getLabel())).findAny().orElse(null);
 
         assertNotNull(timeoutTemplate);

This is because it was waiting for podTemplate to run and then grabbing metadata, but that metadata will soon be deleted. That aspect is easily correctable using SemaphoreStep. But then I started to see the assertLogNotContains fail. Why should the log not contain this message? We are setting a 10s timeout on agent connection, and either the agent connects in <10s or it connects in >10s; we cannot predict that in the test. So then I was going to delete the log assertion and just use a 101s timeout (distinct from DEFAULT_SLAVE_JENKINS_CONNECTION_TIMEOUT), but wondered what the whole point of the test was to begin with? Presumably to verify that some configuration was taking effect. But looking again at #421 I see that it was patching KubernetesDeclarativeAgent, normally tested in KubernetesDeclarativeAgentTest, yet this test was using a Scripted Pipeline—not even touching the src/main/ code being patched! So it does not seem to have had much if any value.

Copy link
Member

@Vlatombe Vlatombe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Vlatombe Vlatombe merged commit c47e883 into jenkinsci:master Jun 14, 2019
@jglick jglick deleted the runWithSlaveConnectTimeout branch June 14, 2019 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants