Code review comment for lp:~nikwen/ubuntu-push/gmail-missed-messages-cleanup-fix-new

Samuele Pedroni (pedronis) wrote :

I'm still getting -race failures, this is on vivid

$ go version
go version go1.3.3 linux/amd64
$ go test -race
==================
WARNING: DATA RACE
Write by goroutine 10:
  launchpad.net/ubuntu-push/messaging.(*MessagingSuite).TestCleanupInAddNotification()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:349 +0x4a3
  runtime.call16()
      /usr/lib/go/src/pkg/runtime/asm_amd64.s:360 +0x31
  reflect.Value.Call()
      /usr/lib/go/src/pkg/reflect/value.go:411 +0xed
  launchpad.net/gocheck.func·006()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:733 +0x51b
  launchpad.net/gocheck.func·004()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:628 +0xf4

Previous read by goroutine 13:
  launchpad.net/ubuntu-push/messaging.(*MessagingMenu).doCleanUpNotifications()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging.go:89 +0x125
  launchpad.net/ubuntu-push/messaging.(*MessagingMenu).cleanUpNotifications()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging.go:83 +0x77

Goroutine 10 (running) created at:
  launchpad.net/gocheck.(*suiteRunner).forkCall()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:629 +0x42e
  launchpad.net/gocheck.(*suiteRunner).forkTest()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:765 +0xce
  launchpad.net/gocheck.(*suiteRunner).runTest()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:770 +0x3e
  launchpad.net/gocheck.(*suiteRunner).run()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:584 +0x3fd
  launchpad.net/gocheck.Run()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/run.go:76 +0x56
  launchpad.net/gocheck.RunAll()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/run.go:68 +0x12d
  launchpad.net/gocheck.TestingT()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/run.go:56 +0x53c
  launchpad.net/ubuntu-push/messaging.Test()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:36 +0x34
  testing.tRunner()
      /usr/lib/go/src/pkg/testing/testing.go:422 +0x10f

Goroutine 13 (finished) created at:
  launchpad.net/ubuntu-push/messaging.(*MessagingMenu).addNotification()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging.go:66 +0x404
  launchpad.net/ubuntu-push/messaging.func·010()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:318 +0x3ed
  launchpad.net/ubuntu-push/messaging.(*MessagingSuite).TestCleanupInAddNotification()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:338 +0x36b
  runtime.call16()
      /usr/lib/go/src/pkg/runtime/asm_amd64.s:360 +0x31
  reflect.Value.Call()
      /usr/lib/go/src/pkg/reflect/value.go:411 +0xed
  launchpad.net/gocheck.func·006()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:733 +0x51b
  launchpad.net/gocheck.func·004()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:628 +0xf4
==================
==================
WARNING: DATA RACE
Read by goroutine 10:
  reflect.maplen()
      /usr/lib/go/src/pkg/runtime/hashmap.goc:1069 +0x0
  reflect.Value.Len()
      /usr/lib/go/src/pkg/reflect/value.go:1169 +0x16c
  launchpad.net/gocheck.(*hasLenChecker).Check()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/checkers.go:238 +0x197
  launchpad.net/gocheck.(*C).internalCheck()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/helpers.go:204 +0xe1d
  launchpad.net/gocheck.(*C).Check()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/helpers.go:152 +0x9f
  launchpad.net/ubuntu-push/messaging.(*MessagingSuite).TestCleanupInAddNotification()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:375 +0x7f9
  runtime.call16()
      /usr/lib/go/src/pkg/runtime/asm_amd64.s:360 +0x31
  reflect.Value.Call()
      /usr/lib/go/src/pkg/reflect/value.go:411 +0xed
  launchpad.net/gocheck.func·006()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:733 +0x51b
  launchpad.net/gocheck.func·004()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:628 +0xf4

Previous write by goroutine 14:
  runtime.mapdelete()
      /usr/lib/go/src/pkg/runtime/hashmap.goc:948 +0x0
  launchpad.net/ubuntu-push/messaging.(*MessagingMenu).doCleanUpNotifications()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging.go:90 +0x1b5
  launchpad.net/ubuntu-push/messaging.(*MessagingMenu).cleanUpNotifications()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging.go:83 +0x77

Goroutine 10 (running) created at:
  launchpad.net/gocheck.(*suiteRunner).forkCall()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:629 +0x42e
  launchpad.net/gocheck.(*suiteRunner).forkTest()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:765 +0xce
  launchpad.net/gocheck.(*suiteRunner).runTest()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:770 +0x3e
  launchpad.net/gocheck.(*suiteRunner).run()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:584 +0x3fd
  launchpad.net/gocheck.Run()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/run.go:76 +0x56
  launchpad.net/gocheck.RunAll()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/run.go:68 +0x12d
  launchpad.net/gocheck.TestingT()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/run.go:56 +0x53c
  launchpad.net/ubuntu-push/messaging.Test()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:36 +0x34
  testing.tRunner()
      /usr/lib/go/src/pkg/testing/testing.go:422 +0x10f

Goroutine 14 (finished) created at:
  launchpad.net/ubuntu-push/messaging.(*MessagingMenu).addNotification()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging.go:66 +0x404
  launchpad.net/ubuntu-push/messaging.func·010()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:318 +0x3ed
  launchpad.net/ubuntu-push/messaging.(*MessagingSuite).TestCleanupInAddNotification()
      /home/pedronis/canonical/go-ws/src/launchpad.net/ubuntu-push/messaging/messaging_test.go:369 +0x6d3
  runtime.call16()
      /usr/lib/go/src/pkg/runtime/asm_amd64.s:360 +0x31
  reflect.Value.Call()
      /usr/lib/go/src/pkg/reflect/value.go:411 +0xed
  launchpad.net/gocheck.func·006()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:733 +0x51b
  launchpad.net/gocheck.func·004()
      /home/pedronis/canonical/go-ws/src/launchpad.net/gocheck/gocheck.go:628 +0xf4
==================
OK: 13 passed
PASS
Found 2 data race(s)
exit status 66
FAIL launchpad.net/ubuntu-push/messaging 5.702s

« Back to merge proposal