Skip to content

[v0.11 backport] frontend: fix testMultiStageImplicitFrom to account for busybox changes#3438

Merged
crazy-max merged 1 commit intomoby:v0.11from
thaJeztah:0.11_backport_fix_tests2
Dec 28, 2022
Merged

[v0.11 backport] frontend: fix testMultiStageImplicitFrom to account for busybox changes#3438
crazy-max merged 1 commit intomoby:v0.11from
thaJeztah:0.11_backport_fix_tests2

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

It looks like there's some changes between busybox:1.34.0 and up; version 1.34.0 of the image did not have a /usr/bin directory (only /usr/sbin);

docker run --rm -it busybox:1.34.0 ls -al /usr/
total 12
drwxr-xr-x    3 root     root          4096 Sep 13  2021 .
drwxr-xr-x    1 root     root          4096 Dec 27 14:45 ..
drwxr-xr-x    2 daemon   daemon        4096 Sep 13  2021 sbin

But 1.34.1 and up do;

docker run --rm -it busybox:1.34.1 ls -al usr/
total 16
drwxr-xr-x    4 root     root          4096 Dec 21 18:28 .
drwxr-xr-x    1 root     root          4096 Dec 27 14:44 ..
drwxr-xr-x    2 root     root          4096 Dec 21 18:28 bin
drwxr-xr-x    2 daemon   daemon        4096 Dec 21 18:28 sbin

It's not immediately apparent what caused this change, or if it's in busybox itself, or in the official image only;
mirror/busybox@1_34_0...1_34_1

But either way, this change caused a test to fail:

sandbox.go:238: time="2022-12-27T13:45:25.294022820Z" level=debug msg="> creating 4gr5bno8rj7l3k7h9jxe3jhal [/bin/sh -c mkdir /usr/bin && echo -n foo > /usr/bin/go]" span="[golang 2/2] RUN mkdir /usr/bin && echo -n foo > /usr/bin/go"
sandbox.go:238: time="2022-12-27T13:45:25.433886983Z" level=debug msg="sandbox set key processing took 70.062631ms for container 5b4o358g2ryquk4s6ami38gqo"
sandbox.go:238: mkdir: can't create directory '/usr/bin': File exists

(cherry picked from commit 34f9898)

It looks like there's some changes between `busybox:1.34.0` and up; version
1.34.0 of the image did not have a `/usr/bin` directory (only `/usr/sbin`);

    docker run --rm -it busybox:1.34.0 ls -al /usr/
    total 12
    drwxr-xr-x    3 root     root          4096 Sep 13  2021 .
    drwxr-xr-x    1 root     root          4096 Dec 27 14:45 ..
    drwxr-xr-x    2 daemon   daemon        4096 Sep 13  2021 sbin

But 1.34.1 and up do;

    docker run --rm -it busybox:1.34.1 ls -al usr/
    total 16
    drwxr-xr-x    4 root     root          4096 Dec 21 18:28 .
    drwxr-xr-x    1 root     root          4096 Dec 27 14:44 ..
    drwxr-xr-x    2 root     root          4096 Dec 21 18:28 bin
    drwxr-xr-x    2 daemon   daemon        4096 Dec 21 18:28 sbin

It's not immediately apparent what caused this change, or if it's in
busybox itself, or in the official image only;
mirror/busybox@1_34_0...1_34_1

But either way, this change caused a test to fail:

    sandbox.go:238: time="2022-12-27T13:45:25.294022820Z" level=debug msg="> creating 4gr5bno8rj7l3k7h9jxe3jhal [/bin/sh -c mkdir /usr/bin && echo -n foo > /usr/bin/go]" span="[golang 2/2] RUN mkdir /usr/bin && echo -n foo > /usr/bin/go"
    sandbox.go:238: time="2022-12-27T13:45:25.433886983Z" level=debug msg="sandbox set key processing took 70.062631ms for container 5b4o358g2ryquk4s6ami38gqo"
    sandbox.go:238: mkdir: can't create directory '/usr/bin': File exists

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 34f9898)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Copy Markdown
Member Author

Hm.. more to fix in this branch?

2022-12-27T17:31:05.5917475Z === CONT  TestIntegration/TestDiffChardevs/worker=containerd-rootless
2022-12-27T17:31:05.5917991Z === CONT  TestIntegration/TestDiffDeleteDoesNotFollowSymlink/worker=containerd-rootless
2022-12-27T17:31:05.5918326Z     client_test.go:6192: 
2022-12-27T17:31:05.5918593Z         	Error Trace:	/src/client/client_test.go:6192
2022-12-27T17:31:05.5918868Z         	            				/src/client/mergediff_test.go:1425
2022-12-27T17:31:05.5919146Z         	            				/src/client/mergediff_test.go:1269
2022-12-27T17:31:05.5919408Z         	            				/src/client/run.go:196
2022-12-27T17:31:05.5919643Z         	Error:      	content still exists
2022-12-27T17:31:05.5920115Z         	Test:       	TestIntegration/TestDiffDeleteDoesNotFollowSymlink/worker=containerd-rootless
2022-12-27T17:31:05.5920930Z         	Messages:   	[{Digest:sha256:f99584b8bbd55e09bea2eff2cce06eec2c052058a1816496220074bebe7ed1ff Size:57525 CreatedAt:2022-12-27 17:24:28.863507725 +0000 UTC UpdatedAt:0001-01-01 00:00:00 +0000 UTC Labels:map[]}]
2022-12-27T17:31:05.5921363Z     sandbox.go:260: stdout: /usr/bin/sudo
2022-12-27T17:31:05.5921604Z     sandbox.go:260: stderr: /usr/bin/sudo
2022-12-27T17:31:05.5923455Z     sandbox.go:263: > startCmd 2022-12-27 17:24:19.470697359 +0000 UTC m=+121.170985518 [sudo -u #1000 -i -- exec nsenter -U --preserve-credentials -m -t 21370 buildkitd --oci-worker=false --containerd-worker-gc=false --containerd-worker=true --containerd-worker-addr /tmp/bktest_containerd2703691649/containerd.sock --containerd-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --containerd-worker-snapshotter=native --containerd-worker-snapshotter=native --config=/tmp/bktest_config1225912811/buildkitd.toml --root /tmp/bktest_buildkitd2700457048 --addr unix:///tmp/bktest_buildkitd2700457048/buildkitd.sock --debug]
2022-12-27T17:31:05.5924699Z     sandbox.go:263: time="2022-12-27T17:24:19Z" level=debug msg="running in rootless mode"
2022-12-27T17:31:05.5925378Z     sandbox.go:263: time="2022-12-27T17:24:19Z" level=debug msg="remote introspection plugin filters" filters="[type==io.containerd.runtime.v1 type==io.containerd.runtime.v2]"

Trying to find the actual error, but don't see it immediately at a glance

@crazy-max
Copy link
Copy Markdown
Member

Hm.. more to fix in this branch?

2022-12-27T17:31:05.5917475Z === CONT  TestIntegration/TestDiffChardevs/worker=containerd-rootless
2022-12-27T17:31:05.5917991Z === CONT  TestIntegration/TestDiffDeleteDoesNotFollowSymlink/worker=containerd-rootless
2022-12-27T17:31:05.5918326Z     client_test.go:6192: 
2022-12-27T17:31:05.5918593Z         	Error Trace:	/src/client/client_test.go:6192
2022-12-27T17:31:05.5918868Z         	            				/src/client/mergediff_test.go:1425
2022-12-27T17:31:05.5919146Z         	            				/src/client/mergediff_test.go:1269
2022-12-27T17:31:05.5919408Z         	            				/src/client/run.go:196
2022-12-27T17:31:05.5919643Z         	Error:      	content still exists
2022-12-27T17:31:05.5920115Z         	Test:       	TestIntegration/TestDiffDeleteDoesNotFollowSymlink/worker=containerd-rootless
2022-12-27T17:31:05.5920930Z         	Messages:   	[{Digest:sha256:f99584b8bbd55e09bea2eff2cce06eec2c052058a1816496220074bebe7ed1ff Size:57525 CreatedAt:2022-12-27 17:24:28.863507725 +0000 UTC UpdatedAt:0001-01-01 00:00:00 +0000 UTC Labels:map[]}]
2022-12-27T17:31:05.5921363Z     sandbox.go:260: stdout: /usr/bin/sudo
2022-12-27T17:31:05.5921604Z     sandbox.go:260: stderr: /usr/bin/sudo
2022-12-27T17:31:05.5923455Z     sandbox.go:263: > startCmd 2022-12-27 17:24:19.470697359 +0000 UTC m=+121.170985518 [sudo -u #1000 -i -- exec nsenter -U --preserve-credentials -m -t 21370 buildkitd --oci-worker=false --containerd-worker-gc=false --containerd-worker=true --containerd-worker-addr /tmp/bktest_containerd2703691649/containerd.sock --containerd-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --containerd-worker-snapshotter=native --containerd-worker-snapshotter=native --config=/tmp/bktest_config1225912811/buildkitd.toml --root /tmp/bktest_buildkitd2700457048 --addr unix:///tmp/bktest_buildkitd2700457048/buildkitd.sock --debug]
2022-12-27T17:31:05.5924699Z     sandbox.go:263: time="2022-12-27T17:24:19Z" level=debug msg="running in rootless mode"
2022-12-27T17:31:05.5925378Z     sandbox.go:263: time="2022-12-27T17:24:19Z" level=debug msg="remote introspection plugin filters" filters="[type==io.containerd.runtime.v1 type==io.containerd.runtime.v2]"

Trying to find the actual error, but don't see it immediately at a glance

related to #3401

@thaJeztah
Copy link
Copy Markdown
Member Author

Ah, okay, thanks!

@thaJeztah
Copy link
Copy Markdown
Member Author

@crazy-max this one good to go?

@crazy-max crazy-max merged commit 2902790 into moby:v0.11 Dec 28, 2022
@thaJeztah thaJeztah deleted the 0.11_backport_fix_tests2 branch December 28, 2022 15:11
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