Closed HeavyHorst closed 7 years ago
If i run the tests with the race detector enabled then i get:
================== WARNING: DATA RACE Read at 0x00c4200b4198 by goroutine 6: github.com/matryer/vice/queues/nats.(*Transport).makePublisher() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:140 +0xfe github.com/matryer/vice/queues/nats.(*Transport).Send() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:111 +0x161 github.com/matryer/vice/vicetest.testStandardTransportBehaviour() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:97 +0x396 github.com/matryer/vice/vicetest.Transport() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:26 +0x4c github.com/matryer/vice/queues/nats.TestTransport() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:16 +0x341 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c Previous write at 0x00c4200b4198 by goroutine 7: github.com/matryer/vice/queues/nats.(*Transport).makeSubscriber() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:94 +0x204 github.com/matryer/vice/queues/nats.(*Transport).Receive() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:69 +0x15b github.com/matryer/vice/vicetest.testStandardTransportBehaviour.func2() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:83 +0x2e4 Goroutine 6 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:790 +0x568 testing.runTests.func1() /usr/local/go/src/testing/testing.go:1005 +0xa7 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c testing.runTests() /usr/local/go/src/testing/testing.go:1003 +0x521 testing.(*M).Run() /usr/local/go/src/testing/testing.go:922 +0x206 main.main() github.com/matryer/vice/queues/nats/_test/_testmain.go:48 +0x1d3 Goroutine 7 (running) created at: github.com/matryer/vice/vicetest.testStandardTransportBehaviour() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:56 +0x22f github.com/matryer/vice/vicetest.Transport() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:26 +0x4c github.com/matryer/vice/queues/nats.TestTransport() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:16 +0x341 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c ================== ================== WARNING: DATA RACE Read at 0x00c4200949b0 by goroutine 6: runtime.growslice() /usr/local/go/src/runtime/slice.go:82 +0x0 github.com/matryer/vice/queues/nats.(*Transport).makePublisher() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:140 +0x262 github.com/matryer/vice/queues/nats.(*Transport).Send() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:111 +0x161 github.com/matryer/vice/vicetest.testStandardTransportBehaviour() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:98 +0x40a github.com/matryer/vice/vicetest.Transport() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:26 +0x4c github.com/matryer/vice/queues/nats.TestTransport() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:16 +0x341 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c Previous write at 0x00c4200949b0 by goroutine 7: github.com/matryer/vice/queues/nats.(*Transport).makeSubscriber() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:94 +0x1cc github.com/matryer/vice/queues/nats.(*Transport).Receive() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:69 +0x15b github.com/matryer/vice/vicetest.testStandardTransportBehaviour.func2() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:83 +0x2e4 Goroutine 6 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:790 +0x568 testing.runTests.func1() /usr/local/go/src/testing/testing.go:1005 +0xa7 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c testing.runTests() /usr/local/go/src/testing/testing.go:1003 +0x521 testing.(*M).Run() /usr/local/go/src/testing/testing.go:922 +0x206 main.main() github.com/matryer/vice/queues/nats/_test/_testmain.go:48 +0x1d3 Goroutine 7 (running) created at: github.com/matryer/vice/vicetest.testStandardTransportBehaviour() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:56 +0x22f github.com/matryer/vice/vicetest.Transport() /home/rkaufmann/go/src/github.com/matryer/vice/vicetest/test.go:26 +0x4c github.com/matryer/vice/queues/nats.TestTransport() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:16 +0x341 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c ================== ================== WARNING: DATA RACE Read at 0x00c420134208 by goroutine 82: github.com/matryer/vice/queues/nats.(*Transport).makePublisher() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:140 +0xfe github.com/matryer/vice/queues/nats.(*Transport).Send() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:111 +0x161 github.com/matryer/vice/queues/nats.TestSend() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:88 +0x486 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c Previous write at 0x00c420134208 by goroutine 10: github.com/matryer/vice/queues/nats.(*Transport).makeSubscriber() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:94 +0x204 github.com/matryer/vice/queues/nats.(*Transport).Receive() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:69 +0x15b github.com/matryer/vice/queues/nats.TestSend.func1() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:74 +0xbf Goroutine 82 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:790 +0x568 testing.runTests.func1() /usr/local/go/src/testing/testing.go:1005 +0xa7 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c testing.runTests() /usr/local/go/src/testing/testing.go:1003 +0x521 testing.(*M).Run() /usr/local/go/src/testing/testing.go:922 +0x206 main.main() github.com/matryer/vice/queues/nats/_test/_testmain.go:48 +0x1d3 Goroutine 10 (running) created at: github.com/matryer/vice/queues/nats.TestSend() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:67 +0x43c testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c ================== ================== WARNING: DATA RACE Read at 0x00c4200f40d0 by goroutine 82: runtime.growslice() /usr/local/go/src/runtime/slice.go:82 +0x0 github.com/matryer/vice/queues/nats.(*Transport).makePublisher() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:140 +0x262 github.com/matryer/vice/queues/nats.(*Transport).Send() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:111 +0x161 github.com/matryer/vice/queues/nats.TestSend() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:88 +0x486 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c Previous write at 0x00c4200f40d0 by goroutine 10: github.com/matryer/vice/queues/nats.(*Transport).makeSubscriber() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:94 +0x1cc github.com/matryer/vice/queues/nats.(*Transport).Receive() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats.go:69 +0x15b github.com/matryer/vice/queues/nats.TestSend.func1() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:74 +0xbf Goroutine 82 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:790 +0x568 testing.runTests.func1() /usr/local/go/src/testing/testing.go:1005 +0xa7 testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c testing.runTests() /usr/local/go/src/testing/testing.go:1003 +0x521 testing.(*M).Run() /usr/local/go/src/testing/testing.go:922 +0x206 main.main() github.com/matryer/vice/queues/nats/_test/_testmain.go:48 +0x1d3 Goroutine 10 (running) created at: github.com/matryer/vice/queues/nats.TestSend() /home/rkaufmann/go/src/github.com/matryer/vice/queues/nats/nats_test.go:67 +0x43c testing.tRunner() /usr/local/go/src/testing/testing.go:747 +0x16c ==================
Thanks @HeavyHorst
If i run the tests with the race detector enabled then i get: