github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/mongo/mongotest/opts.go (about) 1 package mongotest 2 3 import ( 4 "time" 5 6 "github.com/juju/juju/mongo" 7 ) 8 9 const ( 10 DialTimeout = 5 * time.Minute 11 SocketTimeout = DialTimeout 12 ) 13 14 // DialOpts returns mongo.DialOpts suitable for use in tests that operate 15 // against a real MongoDB server. The timeouts are chosen to avoid failures 16 // caused by slow I/O; we do not expect the timeouts to be reached under 17 // normal circumstances. 18 func DialOpts() mongo.DialOpts { 19 return mongo.DialOpts{ 20 Timeout: DialTimeout, 21 SocketTimeout: SocketTimeout, 22 } 23 }