Flaky test - TestResumesFromCorrectSinceTimeAfterSuccessThenFailure
Job #544933026 failed for c5bb1d23
We have another flaky test - https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/544933026#L1872
=== RUN TestResumesFromCorrectSinceTimeAfterSuccessThenFailure
panic:
assert: mock: The method has been called over 1 times.
Either do one more Mock.On("LogStream").Return(...), or remove extra call.
This call was unexpected:
LogStream(*time.Time)
0: &time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}
at: [mock_logStreamProvider.go:19 log_processor.go:141 log_processor.go:107 asm_amd64.s:1357]
goroutine 70 [running]:
github.com/stretchr/testify/mock.(*Mock).fail(0xc0000ccd20, 0x157195b, 0xa5, 0xc000382800, 0x4, 0x4)
/go/pkg/mod/github.com/stretchr/testify@v1.4.0/mock/mock.go:236 +0x1a0
github.com/stretchr/testify/mock.(*Mock).MethodCalled(0xc0000ccd20, 0x1fec972, 0x9, 0xc000261a30, 0x1, 0x1, 0xc000382680, 0x4, 0x4)
/go/pkg/mod/github.com/stretchr/testify@v1.4.0/mock/mock.go:354 +0x2f9
github.com/stretchr/testify/mock.(*Mock).Called(0xc0000ccd20, 0xc000261a30, 0x1, 0x1, 0x431570, 0x15a2870, 0xc000382640)
/go/pkg/mod/github.com/stretchr/testify@v1.4.0/mock/mock.go:338 +0x1a7
gitlab.com/gitlab-org/gitlab-runner/executors/kubernetes.(*mockLogStreamProvider).LogStream(0xc0000ccd20, 0xc00025ea20, 0xc000261a20, 0x2, 0x2, 0xc00002fa00)
/builds/gitlab-org/gitlab-runner/executors/kubernetes/mock_logStreamProvider.go:19 +0x97
gitlab.com/gitlab-org/gitlab-runner/executors/kubernetes.(*kubernetesLogProcessor).attach(0xc0000ccd70, 0x170ad80, 0xc000382200, 0x16df4c0, 0xc0000ccd20, 0xc0000ab140)
/builds/gitlab-org/gitlab-runner/executors/kubernetes/log_processor.go:141 +0x131
gitlab.com/gitlab-org/gitlab-runner/executors/kubernetes.(*kubernetesLogProcessor).Listen.func1(0xc0000c5b30, 0xc0000ccd70, 0x170ad80, 0xc000382200, 0xc0000ab140, 0x16df4c0, 0xc0000ccd20)
/builds/gitlab-org/gitlab-runner/executors/kubernetes/log_processor.go:107 +0xa9
created by gitlab.com/gitlab-org/gitlab-runner/executors/kubernetes.(*kubernetesLogProcessor).Listen
/builds/gitlab-org/gitlab-runner/executors/kubernetes/log_processor.go:105 +0x13f
FAIL gitlab.com/gitlab-org/gitlab-runner/executors/kubernetes 10.230s
FAIL
The most important part of the error message is:
mock: The method has been called over 1 times.
Either do one more Mock.On("LogStream").Return(...), or remove extra call.
This fails randomly, which means we have some race condition in this test, where the LogStream
call is called more than one time in some cases.