go test  -timeout 20s -race ./bson ./bson/internal/json ./yamgo ./yamgo/connstring ./yamgo/internal ./yamgo/internal/feature ./yamgo/model ./yamgo/private/auth ./yamgo/private/cluster ./yamgo/private/conn ./yamgo/private/msg ./yamgo/private/ops ./yamgo/private/server ./yamgo/readpref
ok      github.com/10gen/mongo-go-driver/bson   1.273s
ok      github.com/10gen/mongo-go-driver/bson/internal/json     16.764s
ok      github.com/10gen/mongo-go-driver/yamgo  1.342s
ok      github.com/10gen/mongo-go-driver/yamgo/connstring       1.051s
ok      github.com/10gen/mongo-go-driver/yamgo/internal 3.014s
ok      github.com/10gen/mongo-go-driver/yamgo/internal/feature 1.019s
ok      github.com/10gen/mongo-go-driver/yamgo/model    1.030s
ok      github.com/10gen/mongo-go-driver/yamgo/private/auth     1.122s
ok      github.com/10gen/mongo-go-driver/yamgo/private/cluster  5.034s
ok      github.com/10gen/mongo-go-driver/yamgo/private/conn     5.027s
ok      github.com/10gen/mongo-go-driver/yamgo/private/msg      1.017s
ok      github.com/10gen/mongo-go-driver/yamgo/private/ops      1.321s
==================
WARNING: DATA RACE
Write at 0x00c420106dd8 by goroutine 19:
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.(*FakeMonitor).SetKind()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:40 +0x75
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestServer_Connection_should_clear_pool_when_monitor_fails()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/server_test.go:140 +0x522
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c

Previous read at 0x00c420106dd8 by goroutine 63:
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.(*FakeMonitor).open()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:50 +0x70
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.(*FakeMonitor).(github.com/10gen/mongo-go-driver/yamgo/internal/servertest.open)-fm()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:22 +0xb1
  github.com/10gen/mongo-go-driver/yamgo/private/server.(*Monitor).heartbeat()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:216 +0x859
  github.com/10gen/mongo-go-driver/yamgo/private/server.StartMonitor.func1()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:46 +0x9a
  github.com/10gen/mongo-go-driver/yamgo/private/server.StartMonitor.func2()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:77 +0x363

Goroutine 19 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:789 +0x568
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1004 +0xa7
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1002 +0x521
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:921 +0x206
  main.main()
      github.com/10gen/mongo-go-driver/yamgo/private/server/_test/_testmain.go:78 +0x1d3

Goroutine 63 (running) created at:
  github.com/10gen/mongo-go-driver/yamgo/private/server.StartMonitor()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:71 +0x42a
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.NewFakeMonitor()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:23 +0x220
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestServer_Connection_should_clear_pool_when_monitor_fails()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/server_test.go:122 +0x19f
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
==================
==================
WARNING: DATA RACE
Write at 0x00c4201ac740 by goroutine 19:
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.(*FakeMonitor).SetKind()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:70 +0xf3
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestServer_Connection_should_clear_pool_when_monitor_fails()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/server_test.go:140 +0x522
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c

Previous read at 0x00c4201ac740 by goroutine 63:
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.(*fakeMonitorConn).Read()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:87 +0x3f
  github.com/10gen/mongo-go-driver/yamgo/private/conn.ExecuteCommands()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/conn/protocol.go:31 +0x193
  github.com/10gen/mongo-go-driver/yamgo/private/server.(*Monitor).describeServer()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:190 +0x7ca
  github.com/10gen/mongo-go-driver/yamgo/private/server.(*Monitor).heartbeat()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:229 +0x14f
  github.com/10gen/mongo-go-driver/yamgo/private/server.StartMonitor.func1()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:46 +0x9a
  github.com/10gen/mongo-go-driver/yamgo/private/server.StartMonitor.func2()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:77 +0x363

Goroutine 19 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:789 +0x568
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1004 +0xa7
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1002 +0x521
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:921 +0x206
  main.main()
      github.com/10gen/mongo-go-driver/yamgo/private/server/_test/_testmain.go:78 +0x1d3

Goroutine 63 (running) created at:
  github.com/10gen/mongo-go-driver/yamgo/private/server.StartMonitor()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor.go:71 +0x42a
  github.com/10gen/mongo-go-driver/yamgo/internal/servertest.NewFakeMonitor()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/internal/servertest/monitor.go:23 +0x220
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestServer_Connection_should_clear_pool_when_monitor_fails()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/server_test.go:122 +0x19f
--- FAIL: TestServer_Connection_should_pool_connections (0.00s)
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
==================
        testing.go:699: race detected during execution of test
--- FAIL: TestMonitor_Subscribe_after_close_should_return_an_error (1.00s)
        testing.go:699: race detected during execution of test
--- FAIL: TestServer_Connection_Write_non_specific_error_should_clear_the_pool (1.00s)
        testing.go:699: race detected during execution of test
--- FAIL: TestServer_Connection_Read_non_specific_error_should_clear_the_pool (1.00s)
==================
WARNING: DATA RACE
Read at 0x00c42023a12d by       testing.go:699: race detected during execution of test
goroutine 14:
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestMonitor_Close_should_close_all_update_channels()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor_test.go:36 +0x1da
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c

Previous write at 0x00c42023a12d by goroutine 66:
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestMonitor_Close_should_close_all_update_channels.func1()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor_test.go:22 +0x70

Goroutine 14 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:789 +0x568
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1004 +0xa7
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1002 +0x521
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:921 +0x206
  main.main()
      github.com/10gen/mongo-go-driver/yamgo/private/server/_test/_testmain.go:78 +0x1d3

Goroutine 66 (finished) created at:
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestMonitor_Close_should_close_all_update_channels()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor_test.go:19 +0xfe
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
==================
==================
WARNING: DATA RACE
Read at 0x00c42023a12e by goroutine 14:
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestMonitor_Close_should_close_all_update_channels()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor_test.go:37 +0x22c
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c

Previous write at 0x00c42023a12e by goroutine 68:
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestMonitor_Close_should_close_all_update_channels.func2()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor_test.go:29 +0x70

Goroutine 14 (running) created at:
  testing.(*T).Run()
      /usr/lib/go/src/testing/testing.go:789 +0x568
  testing.runTests.func1()
      /usr/lib/go/src/testing/testing.go:1004 +0xa7
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
  testing.runTests()
      /usr/lib/go/src/testing/testing.go:1002 +0x521
  testing.(*M).Run()
      /usr/lib/go/src/testing/testing.go:921 +0x206
  main.main()
      github.com/10gen/mongo-go-driver/yamgo/private/server/_test/_testmain.go:78 +0x1d3

Goroutine 68 (finished) created at:
  github.com/10gen/mongo-go-driver/yamgo/private/server_test.TestMonitor_Close_should_close_all_update_channels()
      /home/saghm/code/freaking-go/src/github.com/10gen/mongo-go-driver/yamgo/private/server/monitor_test.go:26 +0x17f
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:746 +0x16c
==================
--- FAIL: TestMonitor_Close_should_close_all_update_channels (1.00s)
        testing.go:699: race detected during execution of test
--- FAIL: TestServer_Connection_should_clear_pool_when_monitor_fails (1.00s)
        testing.go:699: race detected during execution of test
FAIL
FAIL    github.com/10gen/mongo-go-driver/yamgo/private/server   3.027s
ok      github.com/10gen/mongo-go-driver/yamgo/readpref 1.023s
make: *** [makefile:51: test-race] Error 1
