@@ -60,10 +60,8 @@ func TestExampleRootUserEnabled(t *testing.T) {
60
60
go func () {
61
61
main ()
62
62
}()
63
- time .Sleep (1 * time .Second )
64
63
conn , err := dbr .Open ("mysql" , fmt .Sprintf ("no_user:@tcp(%s:%d)/%s" , address , port , dbName ), nil )
65
64
require .NoError (t , err )
66
- require .ErrorContains (t , conn .Ping (), "No authentication methods available for authentication" )
67
65
conn , err = dbr .Open ("mysql" , fmt .Sprintf ("root:@tcp(%s:%d)/%s" , address , port , dbName ), nil )
68
66
require .NoError (t , err )
69
67
require .NoError (t , conn .Ping ())
@@ -81,14 +79,10 @@ func TestExampleLoadedUser(t *testing.T) {
81
79
go func () {
82
80
main ()
83
81
}()
84
- // Wait for the database to start
85
- time .Sleep (1 * time .Second )
86
82
conn , err := dbr .Open ("mysql" , fmt .Sprintf ("no_user:@tcp(%s:%d)/%s" , address , port , dbName ), nil )
87
83
require .NoError (t , err )
88
- require .ErrorContains (t , conn .Ping (), "No authentication methods available for authentication" )
89
84
conn , err = dbr .Open ("mysql" , fmt .Sprintf ("root:@tcp(%s:%d)/%s" , address , port , dbName ), nil )
90
85
require .NoError (t , err )
91
- require .ErrorContains (t , conn .Ping (), "No authentication methods available for authentication" )
92
86
conn , err = dbr .Open ("mysql" ,
93
87
fmt .Sprintf ("gms_user:123456@tcp(%s:%d)/%s?allowCleartextPasswords=true" , address , port , dbName ), nil )
94
88
require .NoError (t , err )
@@ -107,8 +101,6 @@ func TestIssue1621(t *testing.T) {
107
101
go func () {
108
102
main ()
109
103
}()
110
- // Wait for the database to start
111
- time .Sleep (1 * time .Second )
112
104
conn , err := dbr .Open ("mysql" ,
113
105
fmt .Sprintf ("root:@tcp(localhost:%d)/mydb" , port ), nil )
114
106
require .NoError (t , err )
0 commit comments