@@ -126,7 +126,7 @@ func PrintToStdout(t *testing.T, stdout *io.PipeReader,
126126func BuildImage (t * testing.T , path string , tag string ) error {
127127 var err error
128128 cli , stdout , stdoutPipe := GetNewClient ()
129- fmt .Println ("Building docker image" , tag )
129+ fmt .Println ("--- Build docker image" , tag )
130130 go func () {
131131 if err = cli .CmdBuild ("--tag=" + tag , path ); err != nil {
132132 return
@@ -206,7 +206,6 @@ func RunDeisDataTest(t *testing.T, args ...string) {
206206 }
207207 }()
208208 go func () {
209- fmt .Println ("closing read/write pipe" )
210209 time .Sleep (3000 * time .Millisecond )
211210 if err := CloseWrap (stdout , stdoutPipe ); err != nil {
212211 t .Fatalf ("Inspect Element %s" , err )
@@ -229,15 +228,14 @@ func getContainerIds(t *testing.T, uid string) []string {
229228 }
230229 }()
231230 for {
232- if cmdBytes , err := bufio .NewReader (stdout ).ReadString ('\n' ); err == nil {
233- fmt .Print (cmdBytes )
234- if strings .Contains (cmdBytes , uid ) {
235- sliceContainers = utils .Append (sliceContainers , strings .Fields (cmdBytes )[0 ])
236- }
237- } else {
231+ cmdBytes , err := bufio .NewReader (stdout ).ReadString ('\n' )
232+ if err != nil {
238233 break
239234 }
240-
235+ if strings .Contains (cmdBytes , uid ) {
236+ sliceContainers = utils .Append (
237+ sliceContainers , strings .Fields (cmdBytes )[0 ])
238+ }
241239 }
242240 return sliceContainers
243241}
@@ -272,8 +270,7 @@ func stopContainers(t *testing.T, sliceContainerIds []string) {
272270 cli , stdout , stdoutPipe := GetNewClient ()
273271 go func () {
274272 for _ , value := range sliceContainerIds {
275- err := cli .CmdStop (value )
276- if err != nil {
273+ if err := cli .CmdStop (value ); err != nil {
277274 t .Log ("stop container failed:" , err )
278275 }
279276 }
@@ -327,7 +324,6 @@ func RunEtcdTest(t *testing.T, uid string, port string) {
327324 }()
328325 go func () {
329326 <- done2
330- fmt .Println ("closing read/write pipe" )
331327 time .Sleep (5000 * time .Millisecond )
332328 if err := CloseWrap (stdout , stdoutPipe ); err != nil {
333329 t .Fatalf ("runEtcdTest %s" , err )
0 commit comments