@@ -17,8 +17,6 @@ import (
17
17
18
18
"github.com/kr/pty"
19
19
"github.com/src-d/engine/cmdtests"
20
- "github.com/src-d/engine/components"
21
- "github.com/src-d/engine/docker"
22
20
"github.com/stretchr/testify/assert"
23
21
"github.com/stretchr/testify/require"
24
22
"github.com/stretchr/testify/suite"
@@ -92,7 +90,6 @@ func (s *SQLREPLTestSuite) TestInteractiveREPL() {
92
90
require .Contains (res , showRepoTableDescOutput )
93
91
94
92
require .NoError (s .exitInteractiveAndWait (10 * time .Second , in , out ))
95
- require .NoError (s .waitMysqlCliContainerStopped (10 , 1 * time .Second ))
96
93
97
94
command .Wait ()
98
95
}
@@ -116,8 +113,9 @@ func (s *SQLREPLTestSuite) runInteractiveRepl() (*exec.Cmd, io.Writer, <-chan st
116
113
117
114
linifier := cmdtests .NewStreamLinifier (1 * time .Second )
118
115
out := linifier .Linify (ch )
116
+
119
117
for s := range out {
120
- if strings .HasPrefix (s , "mysql >" ) {
118
+ if strings .Contains (s , "MySQL [(none)] >" ) {
121
119
return command , in , out , nil
122
120
}
123
121
}
@@ -164,23 +162,6 @@ func (s *SQLREPLTestSuite) exitInteractiveAndWait(timeout time.Duration, in io.W
164
162
}
165
163
}
166
164
167
- func (s * SQLREPLTestSuite ) waitMysqlCliContainerStopped (retries int , retryTimeout time.Duration ) error {
168
- for i := 0 ; i < retries ; i ++ {
169
- running , err := docker .IsRunning (components .MysqlCli .Name , "" )
170
- if ! running {
171
- return nil
172
- }
173
-
174
- if err != nil {
175
- return err
176
- }
177
-
178
- time .Sleep (retryTimeout )
179
- }
180
-
181
- return fmt .Errorf ("maximum number of retries (%d) reached while waiting to stop container" , retries )
182
- }
183
-
184
165
// containsSQLOutput returns `true` if the given string is a SQL output table.
185
166
// To detect whether the `out` is a SQL output table, this checks that there
186
167
// are exactly 3 separators matching this regex ``\+-+\+`.
0 commit comments