Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Data race in tests #17

Closed
raulk opened this issue Mar 1, 2019 · 1 comment
Closed

Data race in tests #17

raulk opened this issue Mar 1, 2019 · 1 comment

Comments

@raulk
Copy link
Member

raulk commented Mar 1, 2019

Uncovered by new travis config that runs tests with the -race flag (#16):

=== RUN   TestGoLibp2pStreamTransport
Running Suite: GoLibp2pStreamTransport Suite
============================================
Random Seed: 1551460766
Will run 9 of 9 specs
••••••==================
WARNING: DATA RACE
Write at 0x00000111c4f8 by goroutine 8:
  github.com/libp2p/go-libp2p-transport-upgrader_test.glob..func1.4()
      /home/travis/gopath/src/github.com/libp2p/go-libp2p-transport-upgrader/listener_test.go:102 +0x3a
  github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/leafnodes/runner.go:113 +0xbd
  github.com/onsi/ginkgo/internal/leafnodes.(*runner).run()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/leafnodes/runner.go:64 +0x16a
  github.com/onsi/ginkgo/internal/leafnodes.(*SetupNode).Run()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/leafnodes/setup_nodes.go:15 +0xa2
  github.com/onsi/ginkgo/internal/spec.(*Spec).runSample()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/spec/spec.go:193 +0x2c6
  github.com/onsi/ginkgo/internal/spec.(*Spec).Run()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/spec/spec.go:138 +0x145
  github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/specrunner/spec_runner.go:200 +0x172
  github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/specrunner/spec_runner.go:170 +0x4b6
  github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/specrunner/spec_runner.go:66 +0x149
  github.com/onsi/ginkgo/internal/suite.(*Suite).Run()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/internal/suite/suite.go:62 +0x3e1
  github.com/onsi/ginkgo.RunSpecsWithCustomReporters()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/ginkgo_dsl.go:221 +0x367
  github.com/onsi/ginkgo.RunSpecs()
      /home/travis/gopath/pkg/mod/github.com/onsi/ginkgo@v1.7.0/ginkgo_dsl.go:202 +0x99
  github.com/libp2p/go-libp2p-transport-upgrader_test.TestGoLibp2pStreamTransport()
      /home/travis/gopath/src/github.com/libp2p/go-libp2p-transport-upgrader/go_libp2p_stream_transport_suite_test.go:12 +0xf6
  testing.tRunner()
      /home/travis/.gimme/versions/go1.11.5.linux.amd64/src/testing/testing.go:827 +0x162
Previous read at 0x00000111c4f8 by goroutine 87:
  github.com/libp2p/go-libp2p-transport-upgrader.(*listener).handleIncoming.func2()
      /home/travis/gopath/src/github.com/libp2p/go-libp2p-transport-upgrader/listener.go:100 +0xd3
Goroutine 8 (running) created at:
  testing.(*T).Run()
      /home/travis/.gimme/versions/go1.11.5.linux.amd64/src/testing/testing.go:878 +0x659
  testing.runTests.func1()
      /home/travis/.gimme/versions/go1.11.5.linux.amd64/src/testing/testing.go:1119 +0xa8
  testing.tRunner()
      /home/travis/.gimme/versions/go1.11.5.linux.amd64/src/testing/testing.go:827 +0x162
  testing.runTests()
      /home/travis/.gimme/versions/go1.11.5.linux.amd64/src/testing/testing.go:1117 +0x4ee
  testing.(*M).Run()
      /home/travis/.gimme/versions/go1.11.5.linux.amd64/src/testing/testing.go:1034 +0x2ee
  main.main()
      _testmain.go:98 +0x332
Goroutine 87 (running) created at:
  github.com/libp2p/go-libp2p-transport-upgrader.(*listener).handleIncoming()
      /home/travis/gopath/src/github.com/libp2p/go-libp2p-transport-upgrader/listener.go:97 +0x5a4
==================
@Stebalien
Copy link
Member

Fixed by #19.

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

No branches or pull requests

2 participants