So I learned a new trick, running
go test -race
will print stack traces showing you race conditions. This is the greatest thing ever. I've fixed a couple, but I want to make a list of things not fixed yet. I think all that's left are in test cases.
WARNING: DATA RACE
Read by goroutine 63:
[net] 19:08:06.02018 [will-subscriber] outbound wrote disconnect, now closing connection
github.com/shoenig/go-mqtt.Test_Will()
/home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:223 +0x8d3
testing.tRunner()
/usr/local/go/src/pkg/testing/testing.go:353 +0x12f
gosched0()
/usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
So I learned a new trick, running go test -race will print stack traces showing you race conditions. This is the greatest thing ever. I've fixed a couple, but I want to make a list of things not fixed yet. I think all that's left are in test cases.
WARNING: DATA RACE Read by goroutine 63: [net] 19:08:06.02018 [will-subscriber] outbound wrote disconnect, now closing connection github.com/shoenig/go-mqtt.Test_Will() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:223 +0x8d3 testing.tRunner() /usr/local/go/src/pkg/testing/testing.go:353 +0x12f gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
Previous write by goroutine 78: github.com/shoenig/go-mqtt.func·005() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:198 +0x2dd gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
Goroutine 63 (running) created at: testing.RunTests() /usr/local/go/src/pkg/testing/testing.go:433 +0xaef testing.Main() /usr/local/go/src/pkg/testing/testing.go:365 +0xab main.main() github.com/shoenig/go-mqtt/_test/_testmain.go:309 +0xda runtime.main() /usr/local/go/src/pkg/runtime/proc.c:182 +0x91
Goroutine 78 (finished) created at: github.com/shoenig/go-mqtt.func·002() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/router.go:129 +0x450 gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
WARNING: DATA RACE Read by goroutine 79: github.com/shoenig/go-mqtt.Test_Binary_Will() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:283 +0xad6 testing.tRunner() /usr/local/go/src/pkg/testing/testing.go:353 +0x12f gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f [net] 19:08:07.67364 [will-subscriber] incoming stopped
Previous write by goroutine 94: github.com/shoenig/go-mqtt.func·007() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:258 +0x2dd gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
Goroutine 79 (running) created at: testing.RunTests() /usr/local/go/src/pkg/testing/testing.go:433 +0xaef testing.Main() /usr/local/go/src/pkg/testing/testing.go:365 +0xab main.main() github.com/shoenig/go-mqtt/_test/_testmain.go:309 +0xda runtime.main() /usr/local/go/src/pkg/runtime/proc.c:182 +0x91
Goroutine 94 (finished) created at: github.com/shoenig/go-mqtt.func·002() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/router.go:129 +0x450 gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
WARNING: DATA RACE Read by goroutine 79: github.com/shoenig/go-mqtt.Test_Binary_Will() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:287 +0xb44 testing.tRunner() /usr/local/go/src/pkg/testing/testing.go:353 +0x12f gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
Previous write by goroutine 94: github.com/shoenig/go-mqtt.func·007() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/fvt_client_test.go:259 +0x357 gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f
Goroutine 79 (running) created at: testing.RunTests() /usr/local/go/src/pkg/testing/testing.go:433 +0xaef testing.Main() /usr/local/go/src/pkg/testing/testing.go:365 +0xab main.main() github.com/shoenig/go-mqtt/_test/_testmain.go:309 +0xda runtime.main() /usr/local/go/src/pkg/runtime/proc.c:182 +0x91
Goroutine 94 (finished) created at: github.com/shoenig/go-mqtt.func·002() /home/shoenig/code/go/src/github.com/shoenig/go-mqtt/router.go:129 +0x450 gosched0() /usr/local/go/src/pkg/runtime/proc.c:1218 +0x9f