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

autorelay: racy TestBackoff #1727

Closed
marten-seemann opened this issue Sep 2, 2022 · 0 comments · Fixed by #1731
Closed

autorelay: racy TestBackoff #1727

marten-seemann opened this issue Sep 2, 2022 · 0 comments · Fixed by #1731
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@marten-seemann
Copy link
Contributor

=== RUN   TestBackoff
  ==================
  WARNING: DATA RACE
  Read at 0x00c0017393c8 by goroutine 251:
    github.com/libp2p/go-libp2p/p2p/host/autorelay_test.TestBackoff()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/autorelay_test.go:267 +0xa54
    testing.tRunner()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1439 +0x213
    testing.(*T).Run.func1()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1486 +0x47
  
  Previous write at 0x00c0017393c8 by goroutine 261:
    github.com/libp2p/go-libp2p/p2p/host/autorelay_test.TestBackoff.func3()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/autorelay_test.go:246 +0x58
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).findNodes()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:238 +0x7e4
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).background.func2()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:112 +0x9e
  
  Goroutine 251 (running) created at:
    testing.(*T).Run()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1486 +0x724
    testing.runTests.func1()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1839 +0x99
    testing.tRunner()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1[439](https://github.com/libp2p/go-libp2p/runs/8150958283?check_suite_focus=true#step:9:441) +0x213
    testing.runTests()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1837 +0x7e4
    testing.(*M).Run()
        /opt/hostedtoolcache/go/1.18.5/x64/src/testing/testing.go:1719 +0xa71
    main.main()
        _testmain.go:67 +0x2e4
  
  Goroutine 261 (running) created at:
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).background()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:110 +0x25e
    github.com/libp2p/go-libp2p/p2p/host/autorelay.(*relayFinder).Start.func1()
        /home/runner/work/go-libp2p/go-libp2p/p2p/host/autorelay/relay_finder.go:658 +0x9e
  ==================
      testing.go:1312: race detected during execution of test
  --- FAIL: TestBackoff (0.14s)
  === RUN   TestStaticRelays
  --- PASS: TestStaticRelays (0.47s)
  === RUN   TestRelayV1
  === RUN   TestRelayV1/relay_v1_support_disabled
  === RUN   TestRelayV1/relay_v1_support_enabled
  --- PASS: TestRelayV1 (0.42s)
      --- PASS: TestRelayV1/relay_v1_support_disabled (0.29s)
      --- PASS: TestRelayV1/relay_v1_support_enabled (0.13s)
  === RUN   TestConnectOnDisconnect
  --- PASS: TestConnectOnDisconnect (0.51s)
  === RUN   TestMaxAge
  --- PASS: TestMaxAge (1.40s)
  === CONT  
      testing.go:1312: race detected during execution of test
  FAIL
  FAIL	github.com/libp2p/go-libp2p/p2p/host/autorelay	6.362s
@marten-seemann marten-seemann added the kind/bug A bug in existing code (including security flaws) label Sep 2, 2022
@marten-seemann marten-seemann self-assigned this Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant