Browse code

Update the unit test to reflect the new CmdRun behaviour in tty mode

Guillaume J. Charmes authored on 2013/04/10 00:18:36
Showing 1 changed files
... ...
@@ -228,15 +228,13 @@ func TestRunDisconnectTty(t *testing.T) {
228 228
 		<-c1
229 229
 	})
230 230
 
231
-	// Client disconnect after run -i should cause stdin to be closed, which should
232
-	// cause /bin/cat to exit.
233
-	setTimeout(t, "Waiting for /bin/cat to exit timed out", 2*time.Second, func() {
234
-		container := runtime.List()[0]
235
-		container.Wait()
236
-		if container.State.Running {
237
-			t.Fatalf("/bin/cat is still running after closing stdin")
238
-		}
239
-	})
231
+	// Client disconnect after run -i should keep stdin out in TTY mode
232
+	container := runtime.List()[0]
233
+	// Give some time to monitor to do his thing
234
+	container.WaitTimeout(500 * time.Millisecond)
235
+	if !container.State.Running {
236
+		t.Fatalf("/bin/cat should  still be running after closing stdin (tty mode)")
237
+	}
240 238
 }
241 239
 
242 240
 // TestAttachStdin checks attaching to stdin without stdout and stderr.