[WIP] use Go's native t.TempDir() in tests - #43346
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
b5dfee2 to
6fba5cd
Compare
|
FWIW, this one helps me feel better about #43340 😅 Somehow using |
|
Ah! I see you found this one as well; yes, I like |
7df50f3 to
e17e815
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
eecdcb1 to
77d808c
Compare
|
Getting closer; Windows is green now! rootless is still failing on this one; Linux still has some failures; |
c54fc40 to
1e44eff
Compare
This comment was marked as outdated.
This comment was marked as outdated.
b32d67d to
3a5426c
Compare
|
Remaining ones on Windows (still debugging this one); rootless: Linux: arm64 (different version of Linux?) |
9f60524 to
21378d0
Compare
21378d0 to
f47a4a3
Compare
f47a4a3 to
c5ea5c5
Compare
|
Failing on integration; rootless; Failing on integration; systemd; Failing unit-test: I may split this one up in smaller chunks, and leave the ones that need more attention. |
130dff9 to
ea5ec46
Compare
21d4083 to
def1db8
Compare
def1db8 to
4621af0
Compare
2bcfc97 to
5ac8969
Compare
5ac8969 to
bcf841e
Compare
bcf841e to
ea50358
Compare
Signed-off-by: Sebastiaan van Stijn <[email protected]>
=== RUN TestSysctlOverride
testing.go:1090: TempDir RemoveAll cleanup: unlinkat /tmp/TestSysctlOverride2860094781/001/mounts/shm: device or resource busy
--- FAIL: TestSysctlOverride (0.00s)
fix panic in TestTmpfsDevShmNoDupMount
=== RUN TestTmpfsDevShmNoDupMount
--- FAIL: TestTmpfsDevShmNoDupMount (0.01s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1209078]
goroutine 110 [running]:
testing.tRunner.func1.2({0x180e0e0, 0x2af5180})
/usr/local/go/src/testing/testing.go:1389 +0x1c8
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1392 +0x380
panic({0x180e0e0, 0x2af5180})
/usr/local/go/src/runtime/panic.go:838 +0x20c
github.com/docker/docker/plugin.(*Store).getAllByCap(0x0?, {0x1aa19ca?, 0x4000963d48?})
/go/src/github.com/docker/docker/plugin/store.go:76 +0x38
github.com/docker/docker/plugin.(*Store).GetAllManagedPluginsByCap(...)
/go/src/github.com/docker/docker/plugin/store.go:178
github.com/docker/docker/daemon.(*Daemon).cleanupMetricsPlugins(0x4000169680)
/go/src/github.com/docker/docker/daemon/metrics.go:113 +0x7c
github.com/docker/docker/daemon.(*Daemon).Shutdown(0x4000169680)
/go/src/github.com/docker/docker/daemon/daemon.go:1226 +0x5f8
github.com/docker/docker/daemon.setupFakeDaemon.func1()
/go/src/github.com/docker/docker/daemon/oci_linux_test.go:50 +0x34
testing.(*common).Cleanup.func1()
/usr/local/go/src/testing/testing.go:1034 +0x10c
testing.(*common).runCleanup(0x4000ac44e0, 0x1dba270?)
/usr/local/go/src/testing/testing.go:1203 +0x9c
testing.tRunner.func2()
/usr/local/go/src/testing/testing.go:1433 +0x30
testing.tRunner(0x4000ac44e0, 0x1b5a968)
/usr/local/go/src/testing/testing.go:1445 +0x13c
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:1486 +0x328
Signed-off-by: Sebastiaan van Stijn <[email protected]>
daemon: fix panic in test
=== Failed
=== FAIL: daemon TestTmpfsDevShmNoDupMount (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x199dc18]
goroutine 566 [running]:
testing.tRunner.func1.2({0x1bd9000, 0x33c1970})
/usr/local/go/src/testing/testing.go:1632 +0x1bc
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1635 +0x334
panic({0x1bd9000?, 0x33c1970?})
/usr/local/go/src/runtime/panic.go:791 +0x124
github.com/docker/docker/daemon.(*fakeImageService).Cleanup(0x0?)
<autogenerated>:1 +0x28
github.com/docker/docker/daemon.(*Daemon).Shutdown(0x40006b26c8, {0x229def8, 0x3540a40})
/go/src/github.com/docker/docker/daemon/daemon.go:1307 +0x644
github.com/docker/docker/daemon.setupFakeDaemon.func1()
/go/src/github.com/docker/docker/daemon/oci_linux_test.go:62 +0x40
testing.(*common).Cleanup.func1()
/usr/local/go/src/testing/testing.go:1176 +0xf8
testing.(*common).runCleanup(0x400057d040, 0x2270000?)
/usr/local/go/src/testing/testing.go:1354 +0xd0
testing.tRunner.func2()
/usr/local/go/src/testing/testing.go:1684 +0x2c
testing.tRunner(0x400057d040, 0x20429f8)
/usr/local/go/src/testing/testing.go:1696 +0x110
created by testing.(*T).Run in goroutine 1
/usr/local/go/src/testing/testing.go:1743 +0x314
Signed-off-by: Sebastiaan van Stijn <[email protected]>
[2022-06-01T12:07:16.248Z] === FAIL: daemon TestSysctlOverride (0.00s)
[2022-06-01T12:07:16.248Z] testing.go:1090: TempDir RemoveAll cleanup: unlinkat /tmp/TestSysctlOverride982023519/001/mounts/shm: device or resource busy
[2022-06-01T12:07:16.248Z]
[2022-06-01T12:07:16.248Z] === FAIL: daemon TestSysctlOverrideHost (0.00s)
[2022-06-01T12:07:16.248Z] testing.go:1090: TempDir RemoveAll cleanup: unlinkat /tmp/TestSysctlOverrideHost881080732/001/mounts/shm: device or resource busy
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Failing on rootless; probably because the parent dir doesn't have
the right permissions;
=== FAIL: amd64.integration.container TestRemoveContainerWithRemovedVolume (0.07s)
remove_test.go:41: assertion failed: error is not nil: Error response from daemon: error while creating mount source path '/tmp/TestRemoveContainerWithRemovedVolume1924909400/001/hostPath': mkdir /tmp/TestRemoveContainerWithRemovedVolume1924909400/001: permission denied
Signed-off-by: Sebastiaan van Stijn <[email protected]>
See if this works to fix;
=== FAIL: amd64.integration-cli TestDockerCLICpSuite/TestCpUnprivilegedUser (0.38s)
docker_cli_cp_test.go:345: assertion failed:
Command: su unprivilegeduser -c /usr/local/cli/docker cp cbdd485903262d9de472b0ec6973675f8266209d5f4e32b2b9bd2759fc2d6794:test /tmp/TestDockerCLICpSuiteTestCpUnprivilegedUser231403686/001
ExitCode: 1
Error: exit status 1
Stdout:
Stderr: lstat /tmp/TestDockerCLICpSuiteTestCpUnprivilegedUser231403686/001: permission denied
Signed-off-by: Sebastiaan van Stijn <[email protected]>
ea50358 to
d9d569f
Compare
follow-up to #43340