Skip to content

Commit c8c36db

Browse files
committed
test
1 parent 3d80c03 commit c8c36db

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

_example/main_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ func TestExampleRootUserEnabled(t *testing.T) {
6060
go func() {
6161
main()
6262
}()
63-
time.Sleep(1 * time.Second)
6463
conn, err := dbr.Open("mysql", fmt.Sprintf("no_user:@tcp(%s:%d)/%s", address, port, dbName), nil)
6564
require.NoError(t, err)
66-
require.ErrorContains(t, conn.Ping(), "No authentication methods available for authentication")
6765
conn, err = dbr.Open("mysql", fmt.Sprintf("root:@tcp(%s:%d)/%s", address, port, dbName), nil)
6866
require.NoError(t, err)
6967
require.NoError(t, conn.Ping())
@@ -81,14 +79,10 @@ func TestExampleLoadedUser(t *testing.T) {
8179
go func() {
8280
main()
8381
}()
84-
// Wait for the database to start
85-
time.Sleep(1 * time.Second)
8682
conn, err := dbr.Open("mysql", fmt.Sprintf("no_user:@tcp(%s:%d)/%s", address, port, dbName), nil)
8783
require.NoError(t, err)
88-
require.ErrorContains(t, conn.Ping(), "No authentication methods available for authentication")
8984
conn, err = dbr.Open("mysql", fmt.Sprintf("root:@tcp(%s:%d)/%s", address, port, dbName), nil)
9085
require.NoError(t, err)
91-
require.ErrorContains(t, conn.Ping(), "No authentication methods available for authentication")
9286
conn, err = dbr.Open("mysql",
9387
fmt.Sprintf("gms_user:123456@tcp(%s:%d)/%s?allowCleartextPasswords=true", address, port, dbName), nil)
9488
require.NoError(t, err)
@@ -107,8 +101,6 @@ func TestIssue1621(t *testing.T) {
107101
go func() {
108102
main()
109103
}()
110-
// Wait for the database to start
111-
time.Sleep(1 * time.Second)
112104
conn, err := dbr.Open("mysql",
113105
fmt.Sprintf("root:@tcp(localhost:%d)/mydb", port), nil)
114106
require.NoError(t, err)

0 commit comments

Comments
 (0)