Skip to content

integration/system: TestInfoAPIWarnings: improve test, and t.Parallel#46395

Draft
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:fix_debuginfo_tests
Draft

integration/system: TestInfoAPIWarnings: improve test, and t.Parallel#46395
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:fix_debuginfo_tests

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Sep 4, 2023

integration/system: TestInfoAPIWarnings: improve test, and t.Parallel

This test takes at least 15 seconds to run, because loadListeners imposes
a 15-second delay for insecure listeners. Rewrite the test to run with
t.Parallel, use a test-table, and add additional test-cases to verify both
cases where the warning should be returned, and should not be returned.

- A picture of a cute animal (not mandatory but encouraged)

Comment thread integration/system/info_test.go Outdated
@thaJeztah
Copy link
Copy Markdown
Member Author

Interesting;

 daemon.go:313: [dab1d02ec42cb] failed to start daemon: error initializing graphdriver: driver not supported: overlay2
    info_test.go:90: [dab1d02ec42cb] failed to start daemon with arguments [--data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/dab1d02ec42cb/root --exec-root /tmp/dxr/dab1d02ec42cb --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/dab1d02ec42cb/docker.pid --userland-proxy=true --containerd-namespace dab1d02ec42cb --containerd-plugins-namespace dab1d02ec42cbp --containerd /var/run/docker/containerd/containerd.sock --host unix:///tmp/docker-integration/dab1d02ec42cb.sock --debug --storage-driver overlay2 -H=unix:///tmp/docker-integration/dab1d02ec42cb.sock -H=tcp://127.0.0.1:23750 --iptables=false] : [dab1d02ec42cb] daemon exited during startup: exit status 1

Also wondering why I see the -H=unix:/// twice in the arguments;

--host unix:///tmp/docker-integration/dab1d02ec42cb.sock --debug --storage-driver overlay2 -H=unix:///tmp/docker-integration/dab1d02ec42cb.sock -H=tcp://127.0.0.1:23750

@thaJeztah
Copy link
Copy Markdown
Member Author

Ah, right, so Windows won't have SecurityOptions by default, so need to update the test for that;

=== FAIL: github.com/docker/docker/integration/system TestInfoAPI (0.02s)
    info_test.go:36: assertion failed: len(info.SecurityOptions) is 0

@thaJeztah thaJeztah force-pushed the fix_debuginfo_tests branch 2 times, most recently from 99ebc5f to 2af715e Compare September 5, 2023 10:17
@thaJeztah
Copy link
Copy Markdown
Member Author

Also wondering why I see the -H=unix:/// twice in the arguments;

--host unix:///tmp/docker-integration/dab1d02ec42cb.sock --debug --storage-driver overlay2 -H=unix:///tmp/docker-integration/dab1d02ec42cb.sock -H=tcp://127.0.0.1:23750

This turned out to be because the test was doing too much, and manually adding the -H=d.Sock(), which is already done automatically by daemon.Start -> daemon.StartWithLogFile ;

if !(d.UseDefaultHost || d.UseDefaultTLSHost) {
d.args = append(d.args, "--host", d.Sock())
}

@thaJeztah
Copy link
Copy Markdown
Member Author

moving this one back to draft; I need to look at the second commit.

@thaJeztah thaJeztah marked this pull request as draft November 3, 2023 09:20
@thaJeztah thaJeztah changed the title integration/system: fix/improve TestInfoAPI, TestInfoAPIWarnings integration/system: TestInfoAPIWarnings: improve test, and t.Parallel Nov 3, 2023
@thaJeztah
Copy link
Copy Markdown
Member Author

Starting artifact upload
For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Artifact name is valid!
Error: Artifact path is not valid: /ubuntu-20.04-rootless/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/docker.log. Contains the following character:  Colon :
          
Invalid characters include:  Double quote ", Colon :, Less than <, Greater than >, Vertical bar |, Asterisk *, Question mark ?, Carriage return \r, Line feed \n

@thaJeztah
Copy link
Copy Markdown
Member Author

daemon.go:313: [df8bd9ce23043] failed to start daemon: error initializing graphdriver: driver not supported: overlay2
Details
=== Failed
=== FAIL: amd64.integration.system TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn (3.73s)
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:03.535513036Z" level=info msg="containerd successfully booted in 0.040261s"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:03.634085520Z" level=debug msg="garbage collected" d="930.704µs"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.489235620Z" level=debug msg="Golang's threads limit set to 49770"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.489855523Z" level=debug msg="metrics API listening on /tmp/dxr/d581ad911f711/metrics.sock"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.493483541Z" level=debug msg="Using default logging driver json-file"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.493768442Z" level=debug msg="processing event stream" module=libcontainerd namespace=d581ad911f711p
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.493808842Z" level=debug msg="No quota support for local volumes in /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/d581ad911f711/root/volumes: Filesystem does not support, or has not enabled quotas"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.501143078Z" level=info msg="[graphdriver] trying configured driver: overlay2"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.529194816Z" level=error msg="failed to mount overlay: no such file or directory" storage-driver=overlay2
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.529248316Z" level=debug msg="daemon configured with a 15 seconds minimum shutdown timeout"
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.529282017Z" level=debug msg="start clean shutdown of all containers with a 15 seconds timeout..."
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.530930625Z" level=debug msg="Cleaning up old mountid : start."
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.532777934Z" level=debug msg="Cleaning up old mountid : done."
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.533803239Z" level=info msg="stopping healthcheck following graceful shutdown" module=libcontainerd
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.534084240Z" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=d581ad911f711p
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.534195241Z" level=debug msg="received signal" signal=terminated
    daemon.go:313: [d581ad911f711] time="2023-11-03T09:35:04.534268841Z" level=debug msg="sd notification" notified=false state="STOPPING=1"
    daemon.go:313: [d581ad911f711] failed to start daemon: error initializing graphdriver: driver not supported: overlay2
    daemon.go:313: [d581ad911f711] [rootlesskit:child ] error: command [/usr/local/bin/dockerd-rootless.sh --data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/d581ad911f711/root --exec-root /tmp/dxr/d581ad911f711 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/d581ad911f711/docker.pid --userland-proxy=true --containerd-namespace d581ad911f711 --containerd-plugins-namespace d581ad911f711p --host unix:///tmp/docker-integration/d581ad911f711.sock --debug --storage-driver overlay2 --host tcp://127.0.0.1:23750 --iptables=false] exited: exit status 1
    daemon.go:313: [d581ad911f711] [rootlesskit:parent] error: child exited: exit status 1
    info_test.go:93: [d581ad911f711] failed to start daemon with arguments [-u unprivilegeduser --preserve-env --preserve-env=PATH XDG_RUNTIME_DIR=/go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/d581ad911f711/xdgrun HOME=/home/unprivilegeduser -- dockerd-rootless.sh --data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/d581ad911f711/root --exec-root /tmp/dxr/d581ad911f711 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn/d581ad911f711/docker.pid --userland-proxy=true --containerd-namespace d581ad911f711 --containerd-plugins-namespace d581ad911f711p --host unix:///tmp/docker-integration/d581ad911f711.sock --debug --storage-driver overlay2 --host tcp://127.0.0.1:23750 --iptables=false] : [d581ad911f711] daemon exited during startup: exit status 1
    --- FAIL: TestInfoAPIWarnings/insecure_on_127.0.0.1:23750_should_warn (3.73s)

=== FAIL: amd64.integration.system TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn (18.71s)
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:22.247001801Z" level=info msg="containerd successfully booted in 0.039080s"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:22.345826916Z" level=debug msg="garbage collected" d="492.802µs"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.204397726Z" level=debug msg="Golang's threads limit set to 49770"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.204918129Z" level=debug msg="metrics API listening on /tmp/dxr/df8bd9ce23043/metrics.sock"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.208910445Z" level=debug msg="Using default logging driver json-file"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.209002146Z" level=debug msg="processing event stream" module=libcontainerd namespace=df8bd9ce23043p
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.209560448Z" level=debug msg="No quota support for local volumes in /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/root/volumes: Filesystem does not support, or has not enabled quotas"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.220242993Z" level=info msg="[graphdriver] trying configured driver: overlay2"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.242625587Z" level=error msg="failed to mount overlay: no such file or directory" storage-driver=overlay2
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.242666887Z" level=debug msg="daemon configured with a 15 seconds minimum shutdown timeout"
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.242680487Z" level=debug msg="start clean shutdown of all containers with a 15 seconds timeout..."
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.244190894Z" level=debug msg="Cleaning up old mountid : start."
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.244803396Z" level=debug msg="Cleaning up old mountid : done."
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.245413899Z" level=info msg="stopping healthcheck following graceful shutdown" module=libcontainerd
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.245612500Z" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=df8bd9ce23043p
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.245803501Z" level=debug msg="received signal" signal=terminated
    daemon.go:313: [df8bd9ce23043] time="2023-11-03T09:35:23.245875501Z" level=debug msg="sd notification" notified=false state="STOPPING=1"
    daemon.go:313: [df8bd9ce23043] failed to start daemon: error initializing graphdriver: driver not supported: overlay2
    daemon.go:313: [df8bd9ce23043] [rootlesskit:child ] error: command [/usr/local/bin/dockerd-rootless.sh --data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/root --exec-root /tmp/dxr/df8bd9ce23043 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/docker.pid --userland-proxy=true --containerd-namespace df8bd9ce23043 --containerd-plugins-namespace df8bd9ce23043p --host unix:///tmp/docker-integration/df8bd9ce23043.sock --debug --storage-driver overlay2 --host tcp://0.0.0.0:23752 --iptables=false] exited: exit status 1
    daemon.go:313: [df8bd9ce23043] [rootlesskit:parent] error: child exited: exit status 1
    info_test.go:93: [df8bd9ce23043] failed to start daemon with arguments [-u unprivilegeduser --preserve-env --preserve-env=PATH XDG_RUNTIME_DIR=/go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/xdgrun HOME=/home/unprivilegeduser -- dockerd-rootless.sh --data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/root --exec-root /tmp/dxr/df8bd9ce23043 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn/df8bd9ce23043/docker.pid --userland-proxy=true --containerd-namespace df8bd9ce23043 --containerd-plugins-namespace df8bd9ce23043p --host unix:///tmp/docker-integration/df8bd9ce23043.sock --debug --storage-driver overlay2 --host tcp://0.0.0.0:23752 --iptables=false] : [df8bd9ce23043] daemon exited during startup: exit status 1
    --- FAIL: TestInfoAPIWarnings/insecure_on_0.0.0.0:23752_should_warn (18.71s)

=== FAIL: amd64.integration.system TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled (3.71s)
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:25.953057152Z" level=info msg="containerd successfully booted in 0.043386s"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.051631621Z" level=debug msg="garbage collected" d="719.003µs"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.913846822Z" level=debug msg="Golang's threads limit set to 49770"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.914266324Z" level=debug msg="metrics API listening on /tmp/dxr/d7c141bea7708/metrics.sock"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.917448939Z" level=debug msg="Using default logging driver json-file"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.917630340Z" level=debug msg="No quota support for local volumes in /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled/d7c141bea7708/root/volumes: Filesystem does not support, or has not enabled quotas"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.917974741Z" level=debug msg="processing event stream" module=libcontainerd namespace=d7c141bea7708p
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.925140975Z" level=info msg="[graphdriver] trying configured driver: overlay2"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.954472715Z" level=error msg="failed to mount overlay: no such file or directory" storage-driver=overlay2
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.954554115Z" level=debug msg="daemon configured with a 15 seconds minimum shutdown timeout"
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.954566415Z" level=debug msg="start clean shutdown of all containers with a 15 seconds timeout..."
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.955799021Z" level=debug msg="Cleaning up old mountid : start."
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.956325824Z" level=debug msg="Cleaning up old mountid : done."
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.956807626Z" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=d7c141bea7708p
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.956819526Z" level=info msg="stopping healthcheck following graceful shutdown" module=libcontainerd
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.957034127Z" level=debug msg="received signal" signal=terminated
    daemon.go:313: [d7c141bea7708] time="2023-11-03T09:35:26.957107327Z" level=debug msg="sd notification" notified=false state="STOPPING=1"
    daemon.go:313: [d7c141bea7708] failed to start daemon: error initializing graphdriver: driver not supported: overlay2
    daemon.go:313: [d7c141bea7708] [rootlesskit:child ] error: command [/usr/local/bin/dockerd-rootless.sh --data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled/d7c141bea7708/root --exec-root /tmp/dxr/d7c141bea7708 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled/d7c141bea7708/docker.pid --userland-proxy=true --containerd-namespace d7c141bea7708 --containerd-plugins-namespace d7c141bea7708p --host unix:///tmp/docker-integration/d7c141bea7708.sock --debug --storage-driver overlay2 --host tcp://0.0.0.0:23754 --tls=false --iptables=false] exited: exit status 1
    daemon.go:313: [d7c141bea7708] [rootlesskit:parent] error: child exited: exit status 1
    info_test.go:93: [d7c141bea7708] failed to start daemon with arguments [-u unprivilegeduser --preserve-env --preserve-env=PATH XDG_RUNTIME_DIR=/go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled/d7c141bea7708/xdgrun HOME=/home/unprivilegeduser -- dockerd-rootless.sh --data-root /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled/d7c141bea7708/root --exec-root /tmp/dxr/d7c141bea7708 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled/d7c141bea7708/docker.pid --userland-proxy=true --containerd-namespace d7c141bea7708 --containerd-plugins-namespace d7c141bea7708p --host unix:///tmp/docker-integration/d7c141bea7708.sock --debug --storage-driver overlay2 --host tcp://0.0.0.0:23754 --tls=false --iptables=false] : [d7c141bea7708] daemon exited during startup: exit status 1
    --- FAIL: TestInfoAPIWarnings/insecure_on_0.0.0.0:23754_with_explicit_TLS_disabled (3.71s)

=== FAIL: amd64.integration.system TestInfoAPIWarnings (28.60s)

This test takes at least 15 seconds to run, because loadListeners imposes
a 15-second delay for insecure listeners. Rewrite the test to run with
t.Parallel, use a test-table, and add additional test-cases to verify both
cases where the warning should be returned, and should _not_ be returned.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the fix_debuginfo_tests branch from 0d0076e to 0952385 Compare August 19, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration: fix TestInfoDebug and other tests that spin up daemons for Windows

1 participant