apiserver/instancepoller: data race in test

Bug #1461385 reported by Dave Cheney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Dave Cheney

Bug Description

==================
WARNING: DATA RACE
Write by goroutine 19:
  github.com/juju/juju/apiserver/instancepoller_test.(*mockBaseWatcher).Stop()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/mock_test.go:351 +0xaa
  github.com/juju/juju/apiserver/instancepoller_test.(*mockConfigWatcher).Stop()
      <autogenerated>:3 +0x68
  github.com/juju/juju/state/testing.AssertStop()
      /home/dfc/src/github.com/juju/juju/state/testing/watcher.go:22 +0x3b
  github.com/juju/juju/apiserver/instancepoller_test.(*InstancePollerSuite).TestWatchForEnvironConfigChangesSuccess()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/instancepoller_test.go:159 +0x88d
  runtime.call32()
      /home/dfc/go/src/runtime/asm_amd64.s:437 +0x44
  reflect.Value.Call()
      /home/dfc/go/src/reflect/value.go:300 +0xd0
  gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /home/dfc/src/gopkg.in/check.v1/check.go:763 +0x5e3
  gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /home/dfc/src/gopkg.in/check.v1/check.go:657 +0x83

Previous read by goroutine 18:
  github.com/juju/juju/apiserver/instancepoller_test.(*mockConfigWatcher).loop()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/mock_test.go:394 +0x86

Goroutine 19 (running) created at:
  gopkg.in/check%2ev1.(*suiteRunner).forkCall()
      /home/dfc/src/gopkg.in/check.v1/check.go:658 +0x489
  gopkg.in/check%2ev1.(*suiteRunner).forkTest()
      /home/dfc/src/gopkg.in/check.v1/check.go:795 +0x129
  gopkg.in/check%2ev1.(*suiteRunner).runTest()
      /home/dfc/src/gopkg.in/check.v1/check.go:800 +0x3f
  gopkg.in/check%2ev1.(*suiteRunner).run()
      /home/dfc/src/gopkg.in/check.v1/check.go:606 +0x49a
  gopkg.in/check%2ev1.Run()
      /home/dfc/src/gopkg.in/check.v1/run.go:92 +0x57
  gopkg.in/check%2ev1.RunAll()
      /home/dfc/src/gopkg.in/check.v1/run.go:84 +0x136
  gopkg.in/check%2ev1.TestingT()
      /home/dfc/src/gopkg.in/check.v1/run.go:72 +0x4b8
  github.com/juju/juju/apiserver/instancepoller_test.TestPackage()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/package_test.go:13 +0x35
  testing.tRunner()
      /home/dfc/go/src/testing/testing.go:454 +0xdf

Goroutine 18 (running) created at:
  github.com/juju/juju/apiserver/instancepoller_test.NewMockConfigWatcher()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/mock_test.go:383 +0x1df
  github.com/juju/juju/apiserver/instancepoller_test.(*mockState).WatchForEnvironConfigChanges()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/mock_test.go:68 +0x15c
  github.com/juju/juju/apiserver/common.(*EnvironWatcher).WatchForEnvironConfigChanges()
      /home/dfc/src/github.com/juju/juju/apiserver/common/environwatcher.go:42 +0x9c
  github.com/juju/juju/apiserver/instancepoller_test.(*InstancePollerSuite).TestWatchForEnvironConfigChangesSuccess()
      /home/dfc/src/github.com/juju/juju/apiserver/instancepoller/instancepoller_test.go:138 +0x7e
  runtime.call32()
      /home/dfc/go/src/runtime/asm_amd64.s:437 +0x44
  reflect.Value.Call()
      /home/dfc/go/src/reflect/value.go:300 +0xd0
  gopkg.in/check%2ev1.(*suiteRunner).forkTest.func1()
      /home/dfc/src/gopkg.in/check.v1/check.go:763 +0x5e3
  gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
      /home/dfc/src/gopkg.in/check.v1/check.go:657 +0x83
==================
OK: 23 passed
PASS
Found 1 data race(s)
FAIL github.com/juju/juju/apiserver/instancepoller 1.371s

Changed in juju-core:
status: New → Confirmed
assignee: nobody → Dave Cheney (dave-cheney)
Changed in juju-core:
status: Confirmed → In Progress
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
milestone: none → 1.25.0
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.