neubot / dash

Go implementation of Neubot's DASH experiment
https://neubot.github.io
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

race in automatic tests #26

Closed bassosimone closed 4 years ago

bassosimone commented 4 years ago

Noticed while investigating why #25 is failing.

Script started on Fri Dec 13 17:18:26 2019
$ go test -timeout 120s -race -v ./cmd/...
=== RUN   TestMain
==================
WARNING: DATA RACE
Read at 0x00c0000e4090 by goroutine 9:
  github.com/neubot/dash/server.(*Handler).reaperLoop()
      /Users/sbasso/src/github.com/neubot/dash/server/server.go:382 +0x5e

Previous write at 0x00c0000e4090 by goroutine 8:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:25 +0x1fe
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 9 (running) created at:
  github.com/neubot/dash/server.(*Handler).StartReaper()
      /Users/sbasso/src/github.com/neubot/dash/server/server.go:396 +0x60
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:23 +0x17a
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 8 (running) created at:
  testing.(*T).Run()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:960 +0x651
  testing.runTests.func1()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:1202 +0xa6
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
  testing.runTests()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:1200 +0x521
  testing.(*M).Run()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:1117 +0x2ff
  main.main()
      _testmain.go:44 +0x223
==================
==================
WARNING: DATA RACE
Write at 0x00000187f560 by goroutine 12:
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /Users/sbasso/go/pkg/mod/github.com/apex/log@v1.1.1/pkg.go:20 +0x899
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous read at 0x00000187f560 by goroutine 9:
  github.com/apex/log.(*Logger).log()
      /Users/sbasso/go/pkg/mod/github.com/apex/log@v1.1.1/logger.go:142 +0x42
  github.com/apex/log.(*Logger).Debug()
      /Users/sbasso/go/pkg/mod/github.com/apex/log@v1.1.1/entry.go:81 +0xd2
  github.com/neubot/dash/server.(*Handler).reaperLoop()
      /Users/sbasso/src/github.com/neubot/dash/server/server.go:382 +0x8d

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 9 (running) created at:
  github.com/neubot/dash/server.(*Handler).StartReaper()
      /Users/sbasso/src/github.com/neubot/dash/server/server.go:396 +0x60
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:23 +0x17a
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

==================

[...]

==================
WARNING: DATA RACE
Write at 0x00c00008a138 by goroutine 13:
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:965 +0x42
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c00008a138 by goroutine 12:
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:965 +0x42
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================
==================
WARNING: DATA RACE
Write at 0x00c00008a150 by goroutine 13:
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:966 +0x5d
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c00008a150 by goroutine 12:
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:966 +0x5d
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================
==================
WARNING: DATA RACE
Write at 0x00c000080e50 by goroutine 13:
  flag.(*stringValue).Set()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:231 +0x3a
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:949 +0x9e8
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c000080e50 by goroutine 12:
  flag.(*stringValue).Set()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:231 +0x3a
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:949 +0x9e8
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================
==================
WARNING: DATA RACE
Write at 0x00c000082cc0 by goroutine 13:
  runtime.mapassign_faststr()
      /usr/local/Cellar/go/1.13.4/libexec/src/runtime/map_faststr.go:202 +0x0
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:956 +0x59e
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c000082cc0 by goroutine 12:
  runtime.mapassign_faststr()
      /usr/local/Cellar/go/1.13.4/libexec/src/runtime/map_faststr.go:202 +0x0
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:956 +0x59e
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================
==================
WARNING: DATA RACE
Write at 0x00c0000859b8 by goroutine 13:
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:956 +0x5b6
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c0000859b8 by goroutine 12:
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:956 +0x5b6
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================
==================
WARNING: DATA RACE
Write at 0x00c00008c2e8 by goroutine 13:
  flag.(*durationValue).Set()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:273 +0x79
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:949 +0x9e8
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c00008c2e8 by goroutine 12:
  flag.(*durationValue).Set()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:273 +0x79
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:949 +0x9e8
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================
==================
WARNING: DATA RACE
Write at 0x00c00008c2c5 by goroutine 13:
  flag.(*boolValue).Set()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:121 +0x7f
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:931 +0x512
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Previous write at 0x00c00008c2c5 by goroutine 12:
  flag.(*boolValue).Set()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:121 +0x7f
  flag.(*FlagSet).parseOne()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:931 +0x512
  flag.(*FlagSet).Parse()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:968 +0x9a
  github.com/neubot/dash/cmd/dash-client.internalmain()
      /usr/local/Cellar/go/1.13.4/libexec/src/flag/flag.go:996 +0x11c
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x48

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================

[...]

==================
WARNING: DATA RACE
Write at 0x00c000080f30 by goroutine 13:
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x69

Previous write at 0x00c000080f30 by goroutine 12:
  github.com/neubot/dash/cmd/dash-client.TestMain.func1()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:38 +0x69

Goroutine 13 (running) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199

Goroutine 12 (finished) created at:
  github.com/neubot/dash/cmd/dash-client.TestMain()
      /Users/sbasso/src/github.com/neubot/dash/cmd/dash-client/main_test.go:36 +0x47b
  testing.tRunner()
      /usr/local/Cellar/go/1.13.4/libexec/src/testing/testing.go:909 +0x199
==================

[...]

--- FAIL: TestMain (56.01s)
    testing.go:853: race detected during execution of test
FAIL
FAIL    github.com/neubot/dash/cmd/dash-client  56.126s
?       github.com/neubot/dash/cmd/dash-server  [no test files]
FAIL
Script done on Fri Dec 13 17:22:14 2019