From 59766067c0725b1bbcab9f5b3ac10648f657bc10 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 19 Jun 2015 06:13:51 +0200 Subject: [PATCH] provisioner/windows-restart: make test pass on slow machines --- provisioner/windows-restart/provisioner_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/provisioner/windows-restart/provisioner_test.go b/provisioner/windows-restart/provisioner_test.go index bbb89e116..247452c22 100644 --- a/provisioner/windows-restart/provisioner_test.go +++ b/provisioner/windows-restart/provisioner_test.go @@ -4,9 +4,10 @@ import ( "bytes" "errors" "fmt" - "github.com/mitchellh/packer/packer" "testing" "time" + + "github.com/mitchellh/packer/packer" ) func testConfig() map[string]interface{} { @@ -256,7 +257,7 @@ func TestProvision_waitForCommunicatorWithCancel(t *testing.T) { comm := new(packer.MockCommunicator) p.comm = comm p.ui = ui - retryableSleep = 10 * time.Millisecond + retryableSleep = 5 * time.Second p.cancel = make(chan struct{}) var err error @@ -273,6 +274,7 @@ func TestProvision_waitForCommunicatorWithCancel(t *testing.T) { }() go func() { + time.Sleep(10 * time.Millisecond) p.Cancel() waitDone <- true }()