Quellcode durchsuchen

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

Solomon Hykes vor 12 Jahren
Ursprung
Commit
a7299a3f26
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  1. 1 0
      container_test.go
  2. 2 1
      runtime_test.go

+ 1 - 0
container_test.go

@@ -267,6 +267,7 @@ func TestStart(t *testing.T) {
 	// Try to avoid the timeoout in destroy. Best effort, don't check error
 	cStdin, _ := container.StdinPipe()
 	cStdin.Close()
+	container.WaitTimeout(2 * time.Second)
 }
 
 func TestRun(t *testing.T) {

+ 2 - 1
runtime_test.go

@@ -315,7 +315,7 @@ func TestRestore(t *testing.T) {
 	// Simulate a crash/manual quit of dockerd: process dies, states stays 'Running'
 	cStdin, _ := container2.StdinPipe()
 	cStdin.Close()
-	if err := container2.WaitTimeout(time.Second); err != nil {
+	if err := container2.WaitTimeout(2 * time.Second); err != nil {
 		t.Fatal(err)
 	}
 	container2.State.Running = true
@@ -359,4 +359,5 @@ func TestRestore(t *testing.T) {
 	if err := container3.Run(); err != nil {
 		t.Fatal(err)
 	}
+	container2.State.Running = false
 }