We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EventuallyWithT()
When using EventuallyWithT() from 1.8.3 like so:
package main import ( "testing" "time" "github.com/stretchr/testify/assert" ) func TestEventuallyWithT(t *testing.T) { assert.EventuallyWithT(t, func(c *assert.CollectT) { assert.NoError(c, assert.AnError) }, time.Millisecond, time.Nanosecond) }
the following data race is triggered:
=== RUN TestEventuallyWithT ================== WARNING: DATA RACE Write at 0x00c0000b42a0 by goroutine 26: github.com/stretchr/testify/assert.(*CollectT).Errorf() github.com/stretchr/testify@v1.8.3/assert/assertions.go:1869 +0x110 github.com/stretchr/testify/assert.Fail() github.com/stretchr/testify@v1.8.3/assert/assertions.go:333 +0x358 github.com/stretchr/testify/assert.NoError() github.com/stretchr/testify@v1.8.3/assert/assertions.go:1495 +0xe0 eventuallwitht.TestEventuallyWithT.func1() eventuallwitht/main_test.go:12 +0x58 github.com/stretchr/testify/assert.EventuallyWithT.func1() github.com/stretchr/testify@v1.8.3/assert/assertions.go:1933 +0x44 Previous read at 0x00c0000b42a0 by goroutine 6: github.com/stretchr/testify/assert.(*CollectT).Copy() github.com/stretchr/testify@v1.8.3/assert/assertions.go:1887 +0x58 github.com/stretchr/testify/assert.EventuallyWithT() github.com/stretchr/testify@v1.8.3/assert/assertions.go:1927 +0x354 eventuallwitht.TestEventuallyWithT() eventuallwitht/main_test.go:11 +0x50 testing.tRunner() testing/testing.go:1576 +0x188 testing.(*T).Run.func1() testing/testing.go:1629 +0x40 Goroutine 26 (running) created at: github.com/stretchr/testify/assert.EventuallyWithT() github.com/stretchr/testify@v1.8.3/assert/assertions.go:1932 +0x310 eventuallwitht.TestEventuallyWithT() eventuallwitht/main_test.go:11 +0x50 testing.tRunner() testing/testing.go:1576 +0x188 testing.(*T).Run.func1() testing/testing.go:1629 +0x40 Goroutine 6 (running) created at: testing.(*T).Run() testing/testing.go:1629 +0x5e4 testing.runTests.func1() testing/testing.go:2036 +0x80 testing.tRunner() testing/testing.go:1576 +0x188 testing.runTests() testing/testing.go:2034 +0x700 testing.(*M).Run() testing/testing.go:1906 +0x950 main.main() _testmain.go:47 +0x300 ==================
testify/assert/assertions.go
Line 1869 in f97607b
Line 1879 in f97607b
Line 1887 in f97607b
It seems that those .errors accesses should be guarded with a lock.
.errors
The text was updated successfully, but these errors were encountered:
github.com/stretchr/testify
assert.EventuallyWithT
Successfully merging a pull request may close this issue.
When using
EventuallyWithT()
from 1.8.3 like so:the following data race is triggered:
testify/assert/assertions.go
Line 1869 in f97607b
testify/assert/assertions.go
Line 1879 in f97607b
testify/assert/assertions.go
Line 1887 in f97607b
It seems that those
.errors
accesses should be guarded with a lock.The text was updated successfully, but these errors were encountered: