ssvlabs / ssv-spec

GNU General Public License v3.0
25 stars 21 forks source link

`TestingVerifier()` causes data race in tests #411

Closed GalRogozinski closed 1 month ago

GalRogozinski commented 1 month ago
==================
WARNING: DATA RACE
Read at 0x0000019de688 by goroutine 56:
  github.com/ssvlabs/ssv-spec/types/testingutils.NewTestingVerifier()
      /home/runner/work/ssv-spec/ssv-spec/types/testingutils/verifier.go:25 +0x44
  github.com/ssvlabs/ssv-spec/types/testingutils.glob..func36()
      /home/runner/work/ssv-spec/ssv-spec/types/testingutils/committee.go:28 +0x22e
  github.com/ssvlabs/ssv-spec/ssv/spectest/tests/committee/singleduty.StartDuty()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/tests/committee/singleduty/start_duty.go:30 +0x1f8
  github.com/ssvlabs/ssv-spec/ssv/spectest.TestAll.func1()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/run_test.go:36 +0x42
  github.com/ssvlabs/ssv-spec/ssv/spectest.TestAll.func2()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/run_test.go:41 +0x47

Previous write at 0x0000019de688 by goroutine 57:
  github.com/ssvlabs/ssv-spec/types/testingutils.NewTestingVerifier()
      /home/runner/work/ssv-spec/ssv-spec/types/testingutils/verifier.go:29 +0x150
  github.com/ssvlabs/ssv-spec/types/testingutils.glob..func36()
      /home/runner/work/ssv-spec/ssv-spec/types/testingutils/committee.go:28 +0x22e
  github.com/ssvlabs/ssv-spec/ssv/spectest/tests/committee/singleduty.StartNoDuty()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/tests/committee/singleduty/start_no_duties.go:17 +0x5e
  github.com/ssvlabs/ssv-spec/ssv/spectest.TestAll.func1()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/run_test.go:36 +0x42
  github.com/ssvlabs/ssv-spec/ssv/spectest.TestAll.func2()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/run_test.go:41 +0x47

Goroutine 56 (running) created at:
  github.com/ssvlabs/ssv-spec/ssv/spectest.TestAll()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/run_test.go:35 +0x8b
  testing.tRunner()
      /opt/hostedtoolcache/go/1.20.14/x64/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.20.14/x64/src/testing/testing.go:1629 +0x47

Goroutine 57 (running) created at:
  github.com/ssvlabs/ssv-spec/ssv/spectest.TestAll()
      /home/runner/work/ssv-spec/ssv-spec/ssv/spectest/run_test.go:35 +0x8b
  testing.tRunner()
      /opt/hostedtoolcache/go/1.20.14/x64/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.20.14/x64/src/testing/testing.go:1629 +0x47
GalRogozinski commented 1 month ago

Closed by #414