Flaky test: `TestLocalSourceDiffer`

Open
#4,358 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
go
Domain
testing-qa

Research direction

Start by reading client/client_test.go around lines 1824 and 1891, then rerun TestIntegration/TestLocalSourceDiffer with the oci-rootless and metadata variants. Compare the expected and actual file contents and the sandbox logs to isolate the nondeterminism. Done means the test no longer intermittently reports foo versus bar and the affected integration test passes.

Written by the indexing model from the issue text.

Description

area/testing

https://github.com/moby/buildkit/actions/runs/6586460590/job/17895020631?pr=4357#step:8:1803

=== FAIL: client TestIntegration/TestLocalSourceDiffer/worker=oci-rootless/differ=metadata (0.05s)
    client_test.go:1891: 
        	Error Trace:	/src/client/client_test.go:1891
        	            				/src/client/client_test.go:1824
        	Error:      	Not equal: 
        	            	expected: []byte{0x66, 0x6f, 0x6f}
        	            	actual  : []byte{0x62, 0x61, 0x72}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,3 +1,3 @@
        	            	 ([]uint8) (len=3) {
        	            	- 00000000  66 6f 6f                                          |foo|
        	            	+ 00000000  62 61 72                                          |bar|
        	            	 }
        	Test:       	TestIntegration/TestLocalSourceDiffer/worker=oci-rootless/differ=metadata
        --- FAIL: TestIntegration/TestLocalSourceDiffer/worker=oci-rootless/differ=metadata (0.05s)

=== FAIL: client TestIntegration/TestLocalSourceDiffer/worker=oci-rootless (1.84s)
    sandbox.go:128: stdout: /usr/bin/sudo -u #1000 -i -- exec rootlesskit buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2277897340/buildkitd.toml --root /tmp/bktest_buildkitd1544817658 --addr unix:///tmp/bktest_buildkitd1544817658/buildkitd.sock --debug
    sandbox.go:128: stderr: /usr/bin/sudo -u #1000 -i -- exec rootlesskit buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2277897340/buildkitd.toml --root /tmp/bktest_buildkitd1544817658 --addr unix:///tmp/bktest_buildkitd1544817658/buildkitd.sock --debug
    sandbox.go:131: > StartCmd 2023-10-20 10:32:37.99805398 +0000 UTC m=+46.373881209 /usr/bin/sudo -u #1000 -i -- exec rootlesskit buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2277897340/buildkitd.toml --root /tmp/bktest_buildkitd1544817658 --addr unix:///tmp/bktest_buildkitd1544817658/buildkitd.sock --debug
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=info msg="auto snapshotter: using overlayfs"
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="running in rootless mode"
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=info msg="found worker \"lr3obrzra0hn46tuulslx7a8a\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:00bf4d7b224e org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/amd64/v4 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]"
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=info msg="found 1 workers, default=\"lr3obrzra0hn46tuulslx7a8a\""
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=warning msg="currently, only the default worker can be used."
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=info msg="running server on /tmp/bktest_buildkitd1544817658/buildkitd.sock"
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session started" spanID=38fa6a652cd1ec4b traceID=f42b65465dab8fea596ce6a636916d08
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="new ref for local: xx9its7gtewzoxbz3utf1k5ck" span="local://mylocalnone" spanID=f681a353c3d725b2 traceID=292fa4f19fc6ae33bda3d792ea859900
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="diffcopy took: 1.978099ms" span="local://mylocalnone" spanID=6da14fdfdc42c19f traceID=292fa4f19fc6ae33bda3d792ea859900
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="saved xx9its7gtewzoxbz3utf1k5ck as mylocalnone::" span="local://mylocalnone" spanID=f681a353c3d725b2 traceID=292fa4f19fc6ae33bda3d792ea859900
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session finished: <nil>" spanID=38fa6a652cd1ec4b traceID=f42b65465dab8fea596ce6a636916d08
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session started" spanID=1e3bf3d244f21538 traceID=7217a265067406dccf3f705999780736
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="reusing ref for local: xx9its7gtewzoxbz3utf1k5ck" span="local://mylocalnone" spanID=f13c96d096d16b10 traceID=e09f1a9a1bbc8717bf375b64dba9ab93
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="diffcopy took: 1.227223ms" span="local://mylocalnone" spanID=c93a0fd9def89430 traceID=e09f1a9a1bbc8717bf375b64dba9ab93
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session finished: <nil>" spanID=1e3bf3d244f21538 traceID=7217a265067406dccf3f705999780736
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session started" spanID=12a14b8f7daa224f traceID=c7a40fdc2f82b5f6e7feb0ee5da749bd
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="new ref for local: 5gedi72mk6cjxizs7ziublxvi" span="local://mylocalmetadata" spanID=47049fdc0e115c66 traceID=df964c11d495854e08e1310818c69ea1
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="diffcopy took: 1.282929ms" span="local://mylocalmetadata" spanID=ea69010003d900a6 traceID=df964c11d495854e08e1310818c69ea1
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="saved 5gedi72mk6cjxizs7ziublxvi as mylocalmetadata::" span="local://mylocalmetadata" spanID=47049fdc0e115c66 traceID=df964c11d495854e08e1310818c69ea1
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session finished: <nil>" spanID=12a14b8f7daa224f traceID=c7a40fdc2f82b5f6e7feb0ee5da749bd
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session started" spanID=1ad7589455fb0f64 traceID=ee28eac10b233553bf257b86355b8c1c
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="not reusing ref 5gedi72mk6cjxizs7ziublxvi for local: 5gedi72mk6cjxizs7ziublxvi is locked: locked" span="local://mylocalmetadata" spanID=b6524dd9dd0c236a traceID=b930952431bdcc11f7c66245fe92c8db
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="new ref for local: ym2nyr6azcla2rj0ct4sej7rs" span="local://mylocalmetadata" spanID=b6524dd9dd0c236a traceID=b930952431bdcc11f7c66245fe92c8db
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="diffcopy took: 1.392439ms" span="local://mylocalmetadata" spanID=ada44b9ff4a71db5 traceID=b930952431bdcc11f7c66245fe92c8db
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="saved ym2nyr6azcla2rj0ct4sej7rs as mylocalmetadata::" span="local://mylocalmetadata" spanID=b6524dd9dd0c236a traceID=b930952431bdcc11f7c66245fe92c8db
    sandbox.go:131: time="2023-10-20T10:32:38Z" level=debug msg="session finished: <nil>" spanID=1ad7589455fb0f64 traceID=ee28eac10b233553bf257b86355b8c1c
    --- FAIL: TestIntegration/TestLocalSourceDiffer/worker=oci-rootless (1.84s)
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from moby/buildkit

All issues in moby/buildkit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.