Browse code

Merge remote-tracking branch 'origin/unit_test_improvment-2'

Solomon Hykes authored on 2013/04/09 10:29:12
Showing 2 changed files
... ...
@@ -267,6 +267,7 @@ func TestStart(t *testing.T) {
267 267
 	// Try to avoid the timeoout in destroy. Best effort, don't check error
268 268
 	cStdin, _ := container.StdinPipe()
269 269
 	cStdin.Close()
270
+	container.WaitTimeout(2 * time.Second)
270 271
 }
271 272
 
272 273
 func TestRun(t *testing.T) {
... ...
@@ -315,7 +315,7 @@ func TestRestore(t *testing.T) {
315 315
 	// Simulate a crash/manual quit of dockerd: process dies, states stays 'Running'
316 316
 	cStdin, _ := container2.StdinPipe()
317 317
 	cStdin.Close()
318
-	if err := container2.WaitTimeout(time.Second); err != nil {
318
+	if err := container2.WaitTimeout(2 * time.Second); err != nil {
319 319
 		t.Fatal(err)
320 320
 	}
321 321
 	container2.State.Running = true
... ...
@@ -359,4 +359,5 @@ func TestRestore(t *testing.T) {
359 359
 	if err := container3.Run(); err != nil {
360 360
 		t.Fatal(err)
361 361
 	}
362
+	container2.State.Running = false
362 363
 }