Commit 59766067 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/windows-restart: make test pass on slow machines

parent ed4acbc9
...@@ -4,9 +4,10 @@ import ( ...@@ -4,9 +4,10 @@ import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"github.com/mitchellh/packer/packer"
"testing" "testing"
"time" "time"
"github.com/mitchellh/packer/packer"
) )
func testConfig() map[string]interface{} { func testConfig() map[string]interface{} {
...@@ -256,7 +257,7 @@ func TestProvision_waitForCommunicatorWithCancel(t *testing.T) { ...@@ -256,7 +257,7 @@ func TestProvision_waitForCommunicatorWithCancel(t *testing.T) {
comm := new(packer.MockCommunicator) comm := new(packer.MockCommunicator)
p.comm = comm p.comm = comm
p.ui = ui p.ui = ui
retryableSleep = 10 * time.Millisecond retryableSleep = 5 * time.Second
p.cancel = make(chan struct{}) p.cancel = make(chan struct{})
var err error var err error
...@@ -273,6 +274,7 @@ func TestProvision_waitForCommunicatorWithCancel(t *testing.T) { ...@@ -273,6 +274,7 @@ func TestProvision_waitForCommunicatorWithCancel(t *testing.T) {
}() }()
go func() { go func() {
time.Sleep(10 * time.Millisecond)
p.Cancel() p.Cancel()
waitDone <- true waitDone <- true
}() }()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment