fix race in drain integration tests

This commit is contained in:
Alex Dadgar 2018-03-19 15:19:57 -07:00 committed by Michael Schurter
parent c401d5a098
commit 640ebdaef6
1 changed files with 7 additions and 1 deletions

View File

@ -60,7 +60,13 @@ func allocPromoter(t *testing.T, ctx context.Context,
WriteRequest: structs.WriteRequest{Region: "global"},
}
var resp structs.NodeAllocsResponse
require.Nil(t, msgpackrpc.CallWithCodec(codec, "Node.UpdateAlloc", req, &resp))
if err := msgpackrpc.CallWithCodec(codec, "Node.UpdateAlloc", req, &resp); err != nil {
if ctx.Err() == context.Canceled {
return
} else {
require.Nil(t, err)
}
}
}
}