Singleton objects need to be created in the singleton factory rather than as a global variable so that they have a unique object per context in order to allow multiple tests to run in parallel. Test: go test -race ./... Change-Id: Ib6912849e1b849ffe8646882cfb476ddea6c6b55