As seen at
http://reports.vapour.ws/releases/issue/578f7bf1749a567c7344833e
The is a race in github.com/juju/juju/featuretests
WARNING: DATA RACE
Read by goroutine 53:
gopkg.in/mgo%2ev2.(*mongoSocket).kill()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/mgo.v2/socket.go:329 +0x7e5
gopkg.in/mgo%2ev2.(*mongoSocket).Close()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/mgo.v2/socket.go:316 +0xd9
gopkg.in/mgo%2ev2.(*mongoServer).Close()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/mgo.v2/server.go:199 +0x35f
gopkg.in/mgo%2ev2.(*mongoCluster).Release()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/mgo.v2/cluster.go:101 +0x352
gopkg.in/mgo%2ev2.(*mongoCluster).syncServersLoop()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/mgo.v2/cluster.go:363 +0x370
Previous write by goroutine 132:
gopkg.in/mgo%2ev2.ResetStats()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/mgo.v2/stats.go:59 +0x17e
github.com/juju/testing.(*MgoSuite).SetUpTest()
/home/ubuntu/juju-core_2.0-beta13/src/github.com/juju/testing/mgo.go:618 +0x41
github.com/juju/juju/juju/testing.(*JujuConnSuite).SetUpTest()
/home/ubuntu/juju-core_2.0-beta13/src/github.com/juju/juju/juju/testing/conn.go:121 +0x4c
github.com/juju/juju/featuretests.(*syslogSuite).SetUpTest()
/home/ubuntu/juju-core_2.0-beta13/src/github.com/juju/juju/featuretests/syslog_test.go:109 +0x2b4
runtime.call32()
/usr/lib/go-1.6/src/runtime/asm_amd64.s:472 +0x3d
reflect.Value.Call()
/usr/lib/go-1.6/src/reflect/value.go:303 +0xcd
gopkg.in/check%2ev1.(*suiteRunner).runFixture.func1()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/check.v1/check.go:721 +0x1b8
gopkg.in/check%2ev1.(*suiteRunner).forkCall.func1()
/home/ubuntu/juju-core_2.0-beta13/src/gopkg.in/check.v1/check.go:666 +0x80
Looking into mgo. There appeared to be a data race in the way Stats are implemented. menn0 confirmed and suggested a fix. Without the fix I managed to reproduce the race twice in a couple hours of running.
Last night I left a script running to stress feature tests with a fix. It didn't trigger overnight.
Currently the patch doesn't change the outcome of tests in gopkg.in/mgo.v2. However, gopkg.in/ mgo.v2- unstable is where new fixes would be applied so I created a branch there and am testing against that and running a script to stress feature tests with mgo.v2-unstable.
So a little bit of polish and I'll make a PR against mgo in github.