Skip to content
New issue

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

Race in library and tests #231

Closed
andig opened this issue Oct 9, 2023 · 1 comment · Fixed by #233
Closed

Race in library and tests #231

andig opened this issue Oct 9, 2023 · 1 comment · Fixed by #233

Comments

@andig
Copy link
Contributor

andig commented Oct 9, 2023

Run tests with -race:

ok  	github.com/lorenzodonini/ocpp-go/ocpp1.6_test	1.970s
ok  	github.com/lorenzodonini/ocpp-go/ocpp2.0.1_test	2.150s

==================
WARNING: DATA RACE
Write at 0x00c000200e20 by goroutine 57:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*ServerDispatcherTestSuite).SetupTest()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher_test.go:35 +0x660
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:165 +0x184
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000200e20 by goroutine 55:
  ??()
      -:0 +0x100bb7724
  sync/atomic.AddInt32()
      <autogenerated>:1 +0x14
  github.com/stretchr/testify/mock.(*Mock).MethodCalled()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/mock/mock.go:543 +0xce8
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*MockWebsocketServer).Write()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:71 +0x11c
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).dispatchNextRequest()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:559 +0x190
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).messagePump()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:536 +0x960
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).Start.func2()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:396 +0x34

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  github.com/stretchr/testify/suite.runTests()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:220 +0x170
  github.com/stretchr/testify/suite.Run()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:193 +0x748
  github.com/lorenzodonini/ocpp-go/ocppj_test.TestMockOcppJ()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:862 +0xe0
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 55 (running) created at:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:396 +0x1e8
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*ServerDispatcherTestSuite).TestDeleteClient()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher_test.go:165 +0x25c
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c00039eab0 by goroutine 139:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestChargePointSendRequestFailed()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:200 +0x490
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c00039eab0 by goroutine 140:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestChargePointSendRequestFailed.func1()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:188 +0xf4
  github.com/stretchr/testify/mock.(*Mock).MethodCalled()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/mock/mock.go:538 +0xcb0
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*MockWebsocketClient).Write()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:150 +0xb4
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).dispatchNextRequest()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:226 +0x150
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).messagePump()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:208 +0x3f0
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).Start.func1()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:126 +0x34

Goroutine 139 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  github.com/stretchr/testify/suite.runTests()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:220 +0x170
  github.com/stretchr/testify/suite.Run()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:193 +0x748
  github.com/lorenzodonini/ocpp-go/ocppj_test.TestMockOcppJ()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:863 +0x100
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 140 (running) created at:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:126 +0x13c
  github.com/lorenzodonini/ocpp-go/ocppj.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/client.go:121 +0x280
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestChargePointSendRequestFailed()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:193 +0x388
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Write at 0x00c00039fd90 by goroutine 156:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientParallelRequests.func2()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:522 +0xf8

Previous write at 0x00c00039fd90 by goroutine 165:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientParallelRequests.func2()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:522 +0xf8

Goroutine 156 (running) created at:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientParallelRequests()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:520 +0x348
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 165 (finished) created at:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientParallelRequests()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:520 +0x348
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Write at 0x00c0003d4320 by goroutine 177:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientRequestFlow.func3()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:605 +0x144
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientRequestFlow.func4()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:607 +0x44

Previous write at 0x00c0003d4320 by goroutine 181:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientRequestFlow.func3()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:605 +0x144
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientRequestFlow.func4()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:607 +0x44

Goroutine 177 (running) created at:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientRequestFlow()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:603 +0x5c4
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 181 (finished) created at:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientRequestFlow()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:603 +0x5c4
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
sending mocked response to message 2891679795
sending mocked response to message 2684978469
sending mocked response to message 3826712917
sending mocked response to message 1757744008
sending mocked response to message 864572431
sending mocked response to message 3904610530
sending mocked response to message 2352769717
sending mocked response to message 1467159100
sending mocked response to message 4072673761
sending mocked response to message 1255011106
==================
WARNING: DATA RACE
Read at 0x00c000122790 by goroutine 187:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).IsRunning()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:132 +0x78
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientStoppedError()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:66 +0x380
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000122790 by goroutine 188:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).messagePump()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:175 +0x4b4
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).Start.func1()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:126 +0x34

Goroutine 187 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  github.com/stretchr/testify/suite.runTests()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:220 +0x170
  github.com/stretchr/testify/suite.Run()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:193 +0x748
  github.com/lorenzodonini/ocpp-go/ocppj_test.TestMockOcppJ()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:863 +0x100
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 188 (finished) created at:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:126 +0x13c
  github.com/lorenzodonini/ocpp-go/ocppj.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/client.go:121 +0x280
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestClientStoppedError()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:59 +0x2c4
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c000497988 by goroutine 193:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestEnqueueMultipleRequests()
      /Users/andig/htdocs/ocpp-go/ocppj/central_system_test.go:575 +0x4f8
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000497988 by goroutine 194:
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestEnqueueMultipleRequests.func1()
      /Users/andig/htdocs/ocpp-go/ocppj/central_system_test.go:563 +0x3c
  github.com/stretchr/testify/mock.(*Mock).MethodCalled()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/mock/mock.go:538 +0xcb0
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*MockWebsocketServer).Write()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:71 +0x11c
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).dispatchNextRequest()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:559 +0x190
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).messagePump()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:536 +0x960
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).Start.func2()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:396 +0x34

Goroutine 193 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  github.com/stretchr/testify/suite.runTests()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:220 +0x170
  github.com/stretchr/testify/suite.Run()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:193 +0x748
  github.com/lorenzodonini/ocpp-go/ocppj_test.TestMockOcppJ()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:863 +0x100
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 194 (running) created at:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:396 +0x1e8
  github.com/lorenzodonini/ocpp-go/ocppj.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/server.go:134 +0x210
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestEnqueueMultipleRequests()
      /Users/andig/htdocs/ocpp-go/ocppj/central_system_test.go:566 +0x358
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Write at 0x00010178d350 by goroutine 199:
  github.com/lorenzodonini/ocpp-go/ocppj.SetLogger()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj.go:43 +0xa8
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestLogger()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:819 +0x9c
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous read at 0x00010178d350 by goroutine 194:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).messagePump()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:471 +0xb6c
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).Start.func2()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:396 +0x34

Goroutine 199 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  github.com/stretchr/testify/suite.runTests()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:220 +0x170
  github.com/stretchr/testify/suite.Run()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:193 +0x748
  github.com/lorenzodonini/ocpp-go/ocppj_test.TestMockOcppJ()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:863 +0x100
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 194 (finished) created at:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultServerDispatcher).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:396 +0x1e8
  github.com/lorenzodonini/ocpp-go/ocppj.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/server.go:134 +0x210
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestEnqueueMultipleRequests()
      /Users/andig/htdocs/ocpp-go/ocppj/central_system_test.go:566 +0x358
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c00055e810 by goroutine 285:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).IsRunning()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:132 +0x78
  github.com/lorenzodonini/ocpp-go/ocppj.(*Client).Stop()
      /Users/andig/htdocs/ocpp-go/ocppj/client.go:139 +0x130
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestStopDisconnectedClient()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:822 +0x65c
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c00055e810 by goroutine 286:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).messagePump()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:175 +0x4b4
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).Start.func1()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:126 +0x34

Goroutine 285 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  github.com/stretchr/testify/suite.runTests()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:220 +0x170
  github.com/stretchr/testify/suite.Run()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:193 +0x748
  github.com/lorenzodonini/ocpp-go/ocppj_test.TestMockOcppJ()
      /Users/andig/htdocs/ocpp-go/ocppj/ocppj_test.go:863 +0x100
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 286 (finished) created at:
  github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/dispatcher.go:126 +0x13c
  github.com/lorenzodonini/ocpp-go/ocppj.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ocppj/client.go:121 +0x280
  github.com/lorenzodonini/ocpp-go/ocppj_test.(*OcppJTestSuite).TestStopDisconnectedClient()
      /Users/andig/htdocs/ocpp-go/ocppj/charge_point_test.go:803 +0x320
  runtime.call16()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/asm_arm64.s:478 +0x74
  reflect.Value.Call()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/reflect/value.go:380 +0x90
  github.com/stretchr/testify/suite.Run.func1()
      /Users/andig/go/pkg/mod/github.com/stretchr/testify@v1.8.0/suite/suite.go:175 +0x4ac
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: TestMockOcppJ (15.44s)
    --- FAIL: TestMockOcppJ/TestServerDispatcherTimeout (1.00s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestChargePointSendRequestFailed (0.50s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestClientParallelRequests (1.00s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestClientRequestFlow (0.01s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestClientStoppedError (0.02s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestEnqueueMultipleRequests (0.50s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestLogger (0.00s)
        testing.go:1465: race detected during execution of test
    --- FAIL: TestMockOcppJ/TestStopDisconnectedClient (0.21s)
        testing.go:1465: race detected during execution of test
    testing.go:1465: race detected during execution of test
FAIL
FAIL	github.com/lorenzodonini/ocpp-go/ocppj	16.097s
--- FAIL: TestNetworkErrors (0.01s)
    network_test.go:38:
        	Error Trace:	/Users/andig/htdocs/ocpp-go/ws/network_test.go:38
        	            				/Users/andig/htdocs/ocpp-go/ws/suite.go:132
        	            				/Users/andig/htdocs/ocpp-go/ws/network_test.go:333
        	Error:      	Received unexpected error:
        	            	Post "http://localhost:8474/proxies": dial tcp [::1]:8474: connect: connection refused
        	Test:       	TestNetworkErrors
==================
WARNING: DATA RACE
Write at 0x00c0001f61e0 by goroutine 57:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:380 +0x4c
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:266 +0x5a4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c0001f61e0 by goroutine 59:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:380 +0x4c
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors.func4()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:263 +0x44

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 59 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:263 +0x580
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c0001f61e8 by goroutine 57:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:381 +0x8c
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:266 +0x5a4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c0001f61e8 by goroutine 59:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:382 +0xf4
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors.func4()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:263 +0x44

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 59 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:263 +0x580
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Write at 0x00c000392010 by goroutine 57:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:391 +0x274
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:266 +0x5a4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000392010 by goroutine 59:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:391 +0x274
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors.func4()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:263 +0x44

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 59 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:263 +0x580
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c0001f62a0 by goroutine 57:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).error()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:358 +0x3f4
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:395 +0x2e0
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:266 +0x5a4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c0001f62a0 by goroutine 58:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Errors()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:365 +0x78
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors.func2()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:257 +0xc0

Goroutine 57 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 58 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestServerStartErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:256 +0x510
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: TestServerStartErrors (0.20s)
    testing.go:1465: race detected during execution of test
==================
WARNING: DATA RACE
Read at 0x00c0003ba000 by goroutine 164:
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak.func3()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:438 +0x60

Previous write at 0x00c0003ba000 by goroutine 161:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1074 +0x4d0
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:441 +0x68c
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 164 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:435 +0x674
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 161 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294
==================
==================
WARNING: DATA RACE
Read at 0x00c0000ea9a0 by goroutine 164:
  github.com/gorilla/websocket.(*Conn).Close()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:344 +0x74
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak.func3()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:438 +0x58

Previous write at 0x00c0000ea9a0 by goroutine 161:
  github.com/gorilla/websocket.newConn()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:307 +0x294
  github.com/gorilla/websocket.(*Dialer).DialContext()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/client.go:327 +0x1894
  github.com/gorilla/websocket.(*Dialer).Dial()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/client.go:106 +0x248
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1056 +0x188
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:441 +0x68c
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 164 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:435 +0x674
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 161 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294
==================
==================
WARNING: DATA RACE
Read at 0x00c0001b6050 by goroutine 164:
  net.(*conn).ok()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/net.go:170 +0x2c
  net.(*conn).Close()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/net.go:200 +0x38
  net.(*TCPConn).Close()
      <autogenerated>:1 +0x34
  github.com/gorilla/websocket.(*Conn).Close()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:344 +0x88
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak.func3()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:438 +0x58

Previous write at 0x00c0001b6050 by goroutine 167:
  net.newTCPConn()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/tcpsock.go:250 +0x9c
  net.(*sysDialer).doDialTCPProto()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/tcpsock_posix.go:114 +0x31c
  net.(*sysDialer).doDialTCP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/tcpsock_posix.go:68 +0xf4
  net.(*sysDialer).dialTCP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/tcpsock_posix.go:64 +0xf8
  net.(*sysDialer).dialSingle()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/dial.go:649 +0x220
  net.(*sysDialer).dialSerial()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/dial.go:614 +0x1bc
  net.(*sysDialer).dialParallel.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/dial.go:534 +0xb4
  net.(*sysDialer).dialParallel.func3()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/dial.go:549 +0x58

Goroutine 164 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:435 +0x674
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 167 (finished) created at:
  net.(*sysDialer).dialParallel()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/dial.go:549 +0x308
  net.(*Dialer).DialContext()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/dial.go:506 +0x820
  github.com/gorilla/websocket.(*Dialer).DialContext.func2()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/client.go:249 +0x64
  github.com/gorilla/websocket.(*Dialer).DialContext.func3()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/client.go:257 +0x6c
  github.com/gorilla/websocket.(*Dialer).DialContext()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/client.go:291 +0x13d4
  github.com/gorilla/websocket.(*Dialer).Dial()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/client.go:106 +0x248
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1056 +0x188
  github.com/lorenzodonini/ocpp-go/ws.TestWebsocketClientConnectionBreak()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:441 +0x68c
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: TestWebsocketClientConnectionBreak (2.00s)
    testing.go:1465: race detected during execution of test
2023/10/09 08:35:24 http: TLS handshake error from [::1]:52135: tls: failed to verify certificate: x509: certificate signed by unknown authority (possibly because of "x509: invalid signature: parent certificate cannot sign this kind of certificate" while trying to verify candidate authority certificate "localhost")
==================
WARNING: DATA RACE
Read at 0x00c00034c750 by goroutine 338:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Stop()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:423 +0x244
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:981 +0x5bc
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c00034c750 by goroutine 339:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Errors()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:365 +0x7c
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors.func2()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:966 +0xc4

Goroutine 338 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 339 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:963 +0x56c
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c000454498 by goroutine 338:
  github.com/gorilla/websocket.(*Conn).beginMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:472 +0x40
  github.com/gorilla/websocket.(*Conn).NextWriter()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:513 +0x74
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:766 +0x18c
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1006 +0x9c4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000454498 by goroutine 349:
  github.com/gorilla/websocket.(*messageWriter).endMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:539 +0xac
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:626 +0x828
  github.com/gorilla/websocket.(*messageWriter).Close()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:724 +0x88
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:773 +0x1e4
  github.com/lorenzodonini/ocpp-go/ws.(*Client).writePump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:901 +0x420
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start.func2()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1086 +0x34

Goroutine 338 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 349 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1086 +0x67c
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:992 +0x7b0
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Write at 0x00c000312d8e by goroutine 338:
  runtime.slicecopy()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/slice.go:310 +0x0
  github.com/gorilla/websocket.(*messageWriter).Write()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:670 +0x224
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:770 +0x1b0
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1006 +0x9c4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous read at 0x00c000312d88 by goroutine 349:
  runtime.racereadrange()
      <autogenerated>:1 +0x14
  internal/poll.ignoringEINTRIO()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/internal/poll/fd_unix.go:736 +0x3a0
  internal/poll.(*FD).Write()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/internal/poll/fd_unix.go:380 +0x1f0
  net.(*netFD).Write()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/fd_posix.go:96 +0x44
  net.(*conn).Write()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/net.go:191 +0x84
  net.(*TCPConn).Write()
      <autogenerated>:1 +0x4c
  github.com/gorilla/websocket.(*Conn).write()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:391 +0x144
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:614 +0x7c8
  github.com/gorilla/websocket.(*messageWriter).Close()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:724 +0x88
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:773 +0x1e4
  github.com/lorenzodonini/ocpp-go/ws.(*Client).writePump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:901 +0x420
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start.func2()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1086 +0x34

Goroutine 338 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 349 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1086 +0x67c
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:992 +0x7b0
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c0004544a8 by goroutine 338:
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:609 +0x6ec
  github.com/gorilla/websocket.(*messageWriter).Close()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:724 +0x88
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:773 +0x1e4
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1006 +0x9c4
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c0004544a8 by goroutine 349:
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:619 +0x7ec
  github.com/gorilla/websocket.(*messageWriter).Close()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:724 +0x88
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:773 +0x1e4
  github.com/lorenzodonini/ocpp-go/ws.(*Client).writePump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:901 +0x420
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start.func2()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1086 +0x34

Goroutine 338 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 349 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1086 +0x67c
  github.com/lorenzodonini/ocpp-go/ws.TestServerErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:992 +0x7b0
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: TestServerErrors (0.26s)
    testing.go:1465: race detected during execution of test
==================
WARNING: DATA RACE
Read at 0x00c0000ebcd0 by goroutine 365:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).error()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1116 +0x3b8
  github.com/lorenzodonini/ocpp-go/ws.(*Client).readPump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:967 +0x2a0
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start.func3()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1087 +0x34

Previous write at 0x00c0000ebcd0 by goroutine 354:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Errors()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1123 +0x7c
  github.com/lorenzodonini/ocpp-go/ws.TestClientErrors.func3()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1032 +0xc4

Goroutine 365 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Client).Start()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:1087 +0x6e0
  github.com/lorenzodonini/ocpp-go/ws.TestClientErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1050 +0x758
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Goroutine 354 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.TestClientErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1029 +0x5b8
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40
==================
==================
WARNING: DATA RACE
Read at 0x00c000642078 by goroutine 353:
  github.com/gorilla/websocket.(*Conn).beginMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:472 +0x40
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:757 +0xac
  github.com/lorenzodonini/ocpp-go/ws.TestClientErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1063 +0xb70
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000642078 by goroutine 362:
  github.com/gorilla/websocket.(*messageWriter).endMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:539 +0xac
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:626 +0x828
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:763 +0x144
  github.com/lorenzodonini/ocpp-go/ws.(*Server).writePump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:618 +0x418
  github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler.func1()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:554 +0x40

Goroutine 353 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 362 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:554 +0xf3c
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start.func1()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:389 +0x44
  net/http.HandlerFunc.ServeHTTP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2136 +0x48
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/andig/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212 +0x2b8
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2938 +0x298
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2009 +0x8ec
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:3086 +0x4c
==================
==================
WARNING: DATA RACE
Write at 0x00c00064000e by goroutine 353:
  runtime.slicecopy()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/runtime/slice.go:310 +0x0
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:760 +0x104
  github.com/lorenzodonini/ocpp-go/ws.TestClientErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1063 +0xb70
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous read at 0x00c00064000c by goroutine 362:
  runtime.racereadrange()
      <autogenerated>:1 +0x14
  internal/poll.ignoringEINTRIO()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/internal/poll/fd_unix.go:736 +0x3a0
  internal/poll.(*FD).Write()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/internal/poll/fd_unix.go:380 +0x1f0
  net.(*netFD).Write()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/fd_posix.go:96 +0x44
  net.(*conn).Write()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/net.go:191 +0x84
  net.(*TCPConn).Write()
      <autogenerated>:1 +0x4c
  github.com/gorilla/websocket.(*Conn).write()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:391 +0x144
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:614 +0x7c8
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:763 +0x144
  github.com/lorenzodonini/ocpp-go/ws.(*Server).writePump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:618 +0x418
  github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler.func1()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:554 +0x40

Goroutine 353 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 362 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:554 +0xf3c
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start.func1()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:389 +0x44
  net/http.HandlerFunc.ServeHTTP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2136 +0x48
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/andig/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212 +0x2b8
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2938 +0x298
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2009 +0x8ec
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:3086 +0x4c
==================
==================
WARNING: DATA RACE
Read at 0x00c000642088 by goroutine 353:
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:609 +0x6ec
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:763 +0x144
  github.com/lorenzodonini/ocpp-go/ws.TestClientErrors()
      /Users/andig/htdocs/ocpp-go/ws/websocket_test.go:1063 +0xb70
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000642088 by goroutine 362:
  github.com/gorilla/websocket.(*messageWriter).flushFrame()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:619 +0x7ec
  github.com/gorilla/websocket.(*Conn).WriteMessage()
      /Users/andig/go/pkg/mod/github.com/gorilla/websocket@v1.4.1/conn.go:763 +0x144
  github.com/lorenzodonini/ocpp-go/ws.(*Server).writePump()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:618 +0x418
  github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler.func1()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:554 +0x40

Goroutine 353 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1648 +0x5d8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1595 +0x194
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:2052 +0x6d8
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/testing/testing.go:1925 +0x908
  main.main()
      _testmain.go:91 +0x294

Goroutine 362 (running) created at:
  github.com/lorenzodonini/ocpp-go/ws.(*Server).wsHandler()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:554 +0xf3c
  github.com/lorenzodonini/ocpp-go/ws.(*Server).Start.func1()
      /Users/andig/htdocs/ocpp-go/ws/websocket.go:389 +0x44
  net/http.HandlerFunc.ServeHTTP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2136 +0x48
  github.com/gorilla/mux.(*Router).ServeHTTP()
      /Users/andig/go/pkg/mod/github.com/gorilla/mux@v1.7.3/mux.go:212 +0x2b8
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2938 +0x298
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:2009 +0x8ec
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.21.2/libexec/src/net/http/server.go:3086 +0x4c
==================
--- FAIL: TestClientErrors (0.21s)
    testing.go:1465: race detected during execution of test
FAIL
FAIL	github.com/lorenzodonini/ocpp-go/ws	15.820s
FAIL

@andig
Copy link
Contributor Author

andig commented Oct 9, 2023

Two races are striking outside the tests:

github.com/lorenzodonini/ocpp-go/ocppj.SetLogger()

github.com/lorenzodonini/ocpp-go/ocppj.(*DefaultClientDispatcher).IsRunning()

I'm not sure what to do about the first one, PR for second one to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant