@@ -266,24 +266,13 @@ func getImageIds(t *testing.T, uid string) []string {
266266 return sliceImageids
267267}
268268
269- func stopRmContainers (t * testing.T , sliceContainerIds []string ) {
269+ func stopContainers (t * testing.T , sliceContainerIds []string ) {
270270 cli , stdout , stdoutPipe := GetNewClient ()
271- done := make (chan bool , 1 )
272271 go func () {
273272 for _ , value := range sliceContainerIds {
274273 err := cli .CmdStop (value )
275274 if err != nil {
276- t .Fatalf ("stop Container %s" , err )
277- }
278- }
279- done <- true
280- }()
281- go func () {
282- <- done
283- for _ , value := range sliceContainerIds {
284- err := cli .CmdRm (value )
285- if err != nil {
286- t .Fatalf ("stop Container %s" , err )
275+ t .Log ("stop container failed:" , err )
287276 }
288277 }
289278 if err := CloseWrap (stdout , stdoutPipe ); err != nil {
@@ -313,13 +302,14 @@ func removeImages(t *testing.T, sliceImageIds []string) {
313302
314303// ClearTestSession cleans up after a typical test session.
315304func ClearTestSession (t * testing.T , uid string ) {
305+ fmt .Println ("clearing test session" , uid )
316306 sliceContainerIds := getContainerIds (t , uid )
317- sliceImageids := getImageIds (t , uid )
318- //fmt.Println(sliceContainerIds)
319- //fmt.Println(sliceImageids)
320- fmt .Println ("removing containers and images for the test session " + uid )
321- stopRmContainers (t , sliceContainerIds )
322- removeImages (t , sliceImageids )
307+ // sliceImageids := getImageIds(t, uid)
308+ // // fmt.Println(sliceContainerIds)
309+ // // fmt.Println(sliceImageids)
310+ // fmt.Println("removing containers and images for the test session " + uid)
311+ stopContainers (t , sliceContainerIds )
312+ // removeImages(t, sliceImageids)
323313}
324314
325315// GetImageID returns the ID of a docker image.
@@ -353,6 +343,7 @@ func RunEtcdTest(t *testing.T, uid string, port string) {
353343 done2 <- true
354344 RunContainer (t , cli ,
355345 "--name" , "deis-etcd-" + uid ,
346+ "--rm" ,
356347 "-p" , port + ":" + port ,
357348 "-e" , "HOST_IP=" + IPAddress ,
358349 "-e" , "ETCD_ADDR=" + IPAddress + ":" + port ,
0 commit comments