Commit a6608544 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: get rid of data races in tests

parent 6f742cb3
......@@ -99,7 +99,10 @@ func TestCommunicatorRPC(t *testing.T) {
c.startCmd.SetExited(42)
for i := 0; i < 5; i++ {
if cmd.Exited {
cmd.Lock()
exited := cmd.Exited
cmd.Unlock()
if exited {
assert.Equal(cmd.ExitStatus, 42, "should have proper exit status")
break
}
......
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