Race condition detected in unit tests: executors/docker/docker_command_test.go:438 - TestDockerCommandBuildCancel
https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/544511619#L2206
Preparing environment
Running on runner--project-0-concurrent-0 via runner-ih9xd9p3-project-250833-concurrent-0...
==================
WARNING: DATA RACE
Read at 0x00c0000aca30 by goroutine 83:
gitlab.com/gitlab-org/gitlab-runner/executors/docker_test.TestDockerCommandBuildCancel.func1()
/builds/gitlab-org/gitlab-runner/executors/docker/docker_command_test.go:438 +0xa0
Previous write at 0x00c0000aca30 by goroutine 69:
[failed to restore the stack]
Goroutine 83 (running) created at:
time.goFunc()
/usr/local/go/src/time/sleep.go:168 +0x51
Goroutine 69 (running) created at:
testing.(*T).Run()
/usr/local/go/src/testing/testing.go:960 +0x651
testing.runTests.func1()
/usr/local/go/src/testing/testing.go:1202 +0xa6
testing.tRunner()
/usr/local/go/src/testing/testing.go:909 +0x199
testing.runTests()
/usr/local/go/src/testing/testing.go:1200 +0x521
testing.(*M).Run()
/usr/local/go/src/testing/testing.go:1117 +0x2ff
gitlab.com/gitlab-org/gitlab-runner/executors/docker.TestMain()
/builds/gitlab-org/gitlab-runner/executors/docker/docker_test.go:43 +0x16d
main.main()
_testmain.go:264 +0x333
==================
==================
WARNING: DATA RACE
Write at 0x00c0004f0c70 by goroutine 83:
sync/atomic.CompareAndSwapInt32()
/usr/local/go/src/runtime/race_amd64.s:293 +0xb
sync.(*Mutex).Lock()
/usr/local/go/src/sync/mutex.go:74 +0x49
context.(*cancelCtx).cancel()
/usr/local/go/src/context/context.go:362 +0x6c
context.(*timerCtx).cancel()
/usr/local/go/src/context/context.go:440 +0x57
context.WithDeadline.func3()
/usr/local/go/src/context/context.go:416 +0x78
gitlab.com/gitlab-org/gitlab-runner/executors/docker_test.TestDockerCommandBuildCancel.func1()
/builds/gitlab-org/gitlab-runner/executors/docker/docker_command_test.go:438 +0xae
Previous write at 0x00c0004f0c70 by goroutine 69:
[failed to restore the stack]
Goroutine 83 (running) created at:
time.goFunc()
/usr/local/go/src/time/sleep.go:168 +0x51
Goroutine 69 (running) created at:
testing.(*T).Run()
/usr/local/go/src/testing/testing.go:960 +0x651
testing.runTests.func1()
/usr/local/go/src/testing/testing.go:1202 +0xa6
testing.tRunner()
/usr/local/go/src/testing/testing.go:909 +0x199
testing.runTests()
/usr/local/go/src/testing/testing.go:1200 +0x521
testing.(*M).Run()
/usr/local/go/src/testing/testing.go:1117 +0x2ff
gitlab.com/gitlab-org/gitlab-runner/executors/docker.TestMain()
/builds/gitlab-org/gitlab-runner/executors/docker/docker_test.go:43 +0x16d
main.main()
_testmain.go:264 +0x333
==================
Uploading artifacts for failed job
Pulling docker image gitlab/gitlab-runner-helper:x86_64-latest ...
ERROR: Job failed: canceled
ERROR: Failed to cleanup volumes
--- FAIL: TestDockerCommandBuildCancel (1.57s)
docker_command_test.go:437: Interrupt
testing.go:853: race detected during execution of test
FAIL
coverage: 65.8% of statements
FAIL gitlab.com/gitlab-org/gitlab-runner/executors/docker 170.311s
FAIL
--- Starting part 6 of go tests of 'gitlab.com/gitlab-org/gitlab-runner/executors/docker' package with coverprofile in 'atomic' mode:
Edited by Georgi N. Georgiev