mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-07 21:09:14 +00:00
change test to be more predictable
This commit is contained in:
@@ -6,8 +6,6 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/percona/percona-toolkit/src/go/mongolib/proto"
|
||||
|
||||
mgo "gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"gopkg.in/mgo.v2/dbtest"
|
||||
@@ -37,11 +35,10 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
func ExampleServerStatus() {
|
||||
ss := proto.ServerStatus{}
|
||||
if err := session.DB("admin").Run(bson.D{{"serverStatus", 1}, {"recordStats", 1}}, &ss); err != nil {
|
||||
ss := map[string]interface{}{}
|
||||
if err := session.DB("admin").Run(bson.D{{"ping", 1}}, &ss); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("%+v", ss)
|
||||
// Output:
|
||||
|
||||
// Output: map[ok:1]
|
||||
}
|
||||
|
Reference in New Issue
Block a user