há 5 anos atrás
pai
commit
ad9949ec81
1 ficheiros alterados com 2 adições e 6 exclusões
  1. 2 6
      src/qfw/mongodb/mgo_test.go

+ 2 - 6
src/qfw/mongodb/mgo_test.go

@@ -45,11 +45,7 @@ func Test_fmt(t *testing.T) {
 }
 
 func Test_Sim(t *testing.T) {
-	mgo := &MongodbSim{}
-	mgo.MongodbAddr = "192.168.3.207:27083"
-	mgo.Size = 9
-	mgo.DbName = "qfw"
-	mgo.InitPool()
+	mgo := NewMongodbReplPool(5, "192.168.3.207:27083", "qfw", "qfws")
 	p := make(chan bool, 10)
 	j := 0
 	for {
@@ -74,7 +70,7 @@ func Test_Sim(t *testing.T) {
 		time.Sleep(50 * time.Second)
 		log.Println(j, len(mgo.pool), len(mgo.idlePool))
 		j++
-		if j > 2 {
+		if j > 0 {
 			break
 		}
 	}