jenkinsci / docker-plugin

Jenkins cloud plugin that uses Docker
https://plugins.jenkins.io/docker-plugin/
MIT License
490 stars 318 forks source link

Newer httpclient 5 API breaks tests of the docker plugin #1103

Open MarkEWaite opened 2 days ago

MarkEWaite commented 2 days ago

Jenkins and plugins versions report

Environment summary

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 22.04 and Debian without Docker listening on port 2375 fails tests when testing with apache-httpcomponents-client-5-api 5.4-118.v199115451c4d . The same tests pass if tested with apache-httpcomponents-client-5-api 5.3.1-110.v77252fb_d4da_5

Ubuntu 22.04 and Debian with Docker listening on port 2375 passes tests with both versions of apache-httpcomponents-client-5-api

Reproduction steps

  1. Run tests on ci.jenkins.io or on a local computer that does not have a Docker listener on port 2375, confirm tests fail unless the apache-httpcomponents-client-5-api library used in the test is forced to 5.3.1-110.v77252fb_d4da_5

Expected Results

Tests should pass with both the older and the newer version of the apache-httpcomponents-client-5-api library

Actual Results

Test fail unexpectedly unless a Docker listener is available on port 2375

Anything else?

Failure seems to be specific to the tests. Assumed that there is some difference in exception handling between the two versions of the apache-httpcomponents-client-5-api library.

Are you interested in contributing a fix?

Yes, though not sure when time will allow it. A temporary workaround has been applied in:

MarkEWaite commented 2 days ago

@krisstern I'm truly surprised by this failure, but did not want to block the update to the most recent plugin bill of materials. I've assigned it to myself, but I'm not yet sure when I will have time to investigate it.

kirk-fitzsimons commented 19 hours ago

I am getting failing tests locally on latest

[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 9.096 s <<< FAILURE! -- in io.jenkins.docker.client.ConfigurationAsCodeTest [ERROR] io.jenkins.docker.client.ConfigurationAsCodeTest.should_support_old_configuration -- Time elapsed: 7.548 s <<< FAILURE! java.lang.AssertionError: Unexpected exception at io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule.before(JenkinsConfiguredWithCodeRule.java:50) at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:649) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: io.jenkins.plugins.casc.UnknownAttributesException: cloud: No hudson.slaves.Cloud implementation found for docker at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$lookupDescriptor$12(HeteroDescribableConfigurator.java:236) at io.vavr.control.Option.orElse(Option.java:321) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lookupDescriptor(HeteroDescribableConfigurator.java:227) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86) at io.vavr.Tuple2.apply(Tuple2.java:238) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:86) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:94) at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:57) at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:355) at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:293) at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$9(ConfigurationAsCode.java:834) at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:777) at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:834) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:820) at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:699) at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:668) at io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule.before(JenkinsConfiguredWithCodeRule.java:47) ... 3 more

Env: Windows 10 OpenJDK Runtime Environment Temurin-17.0.12+7

MarkEWaite commented 19 hours ago

I am getting failing tests locally on latest

Env: Windows 10 OpenJDK Runtime Environment Temurin-17.0.12+7

Any guess about what is different between your Windows computer and the Windows agent on ci.jenkins.io where the tests pass?

kirk-fitzsimons commented 18 hours ago

I am getting failing tests locally on latest Env: Windows 10 OpenJDK Runtime Environment Temurin-17.0.12+7

Any guess about what is different between your Windows computer and the Windows agent on ci.jenkins.io where the tests pass?

Not sure:

PS C:\Users\fitzsimok\dev\docker-plugin> mvn clean verify -X Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256) Maven home: C:\apache-maven-3.9.8 Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot Default locale: en_US, platform encoding: Cp1252 OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"

kirk-fitz commented 17 hours ago

Hit the same error in wsl(ubuntu) on the same host

Apache Maven 3.9.8 (36645f6c9b5079805ea5009217e36f2cffd34256) Maven home: /mnt/c/apache-maven-3.9.8 Java version: 17.0.12, vendor: Eclipse Adoptium, runtime: /usr/lib/jvm/temurin-17-jdk-amd64 Default locale: en, platform encoding: UTF-8 OS name: "linux", version: "5.15.153.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"