Skip to content

Commit

Permalink
fix race in drain integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar authored and schmichael committed Mar 20, 2018
1 parent 94fb0c0 commit 914fa88
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nomad/drainer_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
}

Expand Down

0 comments on commit 914fa88

Please sign in to comment.