Skip to content

test: use separate container ID for exec phase of worker test#6652

Merged
crazy-max merged 1 commit intomoby:masterfrom
tonistiigi:runc-exec-test
Apr 8, 2026
Merged

test: use separate container ID for exec phase of worker test#6652
crazy-max merged 1 commit intomoby:masterfrom
tonistiigi:runc-exec-test

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

The second Run call in TestWorkerExec reused the same container ID as the first. On CI this occasionally caused the sleep pid1 to exit immediately with status 1, likely due to incomplete kernel-level cleanup from the prior container. Use a fresh ID for the exec-testing phase to avoid any residual state.

This seems most likely reason for flaky test

2026-04-03T23:58:11.9011946Z     common.go:142: 
2026-04-03T23:58:11.9012515Z         	Error Trace:	/src/worker/tests/common.go:142
2026-04-03T23:58:11.9014543Z         	Error:      	Received unexpected error:
2026-04-03T23:58:11.9017002Z         	            	exit code: 1
2026-04-03T23:58:11.9019387Z         	            	github.com/moby/buildkit/util/stack.Enable
2026-04-03T23:58:11.9020497Z         	            		/src/util/stack/stack.go:82
2026-04-03T23:58:11.9022811Z         	            	github.com/moby/buildkit/executor/runcexecutor.exitError
2026-04-03T23:58:11.9025809Z         	            		/src/executor/runcexecutor/executor.go:403
2026-04-03T23:58:11.9027449Z         	            	github.com/moby/buildkit/executor/runcexecutor.(*runcExecutor).Run
2026-04-03T23:58:11.9029770Z         	            		/src/executor/runcexecutor/executor.go:351
2026-04-03T23:58:11.9030859Z         	            	github.com/moby/buildkit/worker/tests.TestWorkerExec.func2
2026-04-03T23:58:11.9033860Z         	            		/src/worker/tests/common.go:113
2026-04-03T23:58:11.9036060Z         	            	golang.org/x/sync/errgroup.(*Group).Go.func1
2026-04-03T23:58:11.9037439Z         	            		/src/vendor/golang.org/x/sync/errgroup/errgroup.go:93
2026-04-03T23:58:11.9038794Z         	            	runtime.goexit
2026-04-03T23:58:11.9039809Z         	            		/usr/local/go/src/runtime/asm_amd64.s:1771
2026-04-03T23:58:11.9040884Z         	            	container dkttqkm4l73ajr60ndxqwonuy has exited with error
2026-04-03T23:58:11.9042029Z         	            	github.com/moby/buildkit/executor/runcexecutor.(*runcExecutor).Exec
2026-04-03T23:58:11.9043359Z         	            		/src/executor/runcexecutor/executor.go:431
2026-04-03T23:58:11.9044358Z         	            	github.com/moby/buildkit/worker/tests.TestWorkerExec
2026-04-03T23:58:11.9045892Z         	            		/src/worker/tests/common.go:133
2026-04-03T23:58:11.9046655Z         	            	github.com/moby/buildkit/worker/runc.TestRuncWorkerExec
2026-04-03T23:58:11.9048072Z         	            		/src/worker/runc/runc_test.go:222
2026-04-03T23:58:11.9049298Z         	            	testing.tRunner
2026-04-03T23:58:11.9050433Z         	            		/usr/local/go/src/testing/testing.go:2036
2026-04-03T23:58:11.9051378Z         	            	runtime.goexit
2026-04-03T23:58:11.9052309Z         	            		/usr/local/go/src/runtime/asm_amd64.s:1771
2026-04-03T23:58:11.9053770Z         	Test:       	TestRuncWorkerExec
2026-04-03T23:58:11.9149579Z --- FAIL: TestRuncWorkerExec (0.80s)

The second Run call in TestWorkerExec reused the same container
ID as the first. On CI this occasionally caused the sleep pid1
to exit immediately with status 1, likely due to incomplete
kernel-level cleanup from the prior container. Use a fresh ID
for the exec-testing phase to avoid any residual state.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@crazy-max crazy-max merged commit 329a9f3 into moby:master Apr 8, 2026
225 of 226 checks passed
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.

2 participants