Esempio n. 1
0
func newTestDB(t *testing.T) *backend.DB {
	newTestServer(t)

	f := func() {
		testDB, _ = backend.Open("127.0.0.1:3601", "root", "", "kingshard", 100)
	}

	testDBOnce.Do(f)
	return testDB
}
Esempio n. 2
0
func newTestDB(t *testing.T) *backend.DB {
	newTestServer(t)

	f := func() {
		testDB = backend.Open("127.0.0.1:3601", "root", "", "kingshard")

		testDB.SetMaxIdleConnNum(4)
	}

	testDBOnce.Do(f)
	return testDB
}
Esempio n. 3
0
func newTestDB(t *testing.T) *backend.DB {
	newTestServer(t)

	f := func() {
		var err error
		testDB, err = backend.Open("127.0.0.1:4000", "root", "", "kingshard")

		if err != nil {
			t.Fatal(err)
		}

		testDB.SetMaxIdleConnNum(4)
	}

	testDBOnce.Do(f)
	return testDB
}