Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tim Gross <tgross@hashicorp.com>
  • Loading branch information
DerekStrickland and tgross authored Apr 5, 2022
1 parent 38ebd95 commit dc7576a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions nomad/node_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3816,9 +3816,8 @@ func TestClientEndpoint_UpdateAlloc_Evals_ByTrigger(t *testing.T) {

// Fetch the response
var nodeResp structs.GenericResponse
if err := msgpackrpc.CallWithCodec(codec, "Node.Register", reg, &nodeResp); err != nil {
t.Fatalf("err: %v", err)
}
err := msgpackrpc.CallWithCodec(codec, "Node.Register", reg, &nodeResp)
require.NoError(t, err)

fsmState := s1.fsm.State()

Expand Down Expand Up @@ -3877,15 +3876,14 @@ func TestClientEndpoint_UpdateAlloc_Evals_ByTrigger(t *testing.T) {
require.NoError(t, err)
require.NotEqual(t, uint64(0), nodeAllocResp.Index)

if diff := time.Since(start); diff < batchUpdateInterval {
t.Fatalf("too fast: %v", diff)
}
diff := time.Since(start)
require.Less(t, diff, batchUpdateInterval, "too fast")

// If no eval should be created validate, none were and return.
if tc.triggerBy == "" {
evaluations, err := fsmState.EvalsByJob(nil, job.Namespace, job.ID)
require.NoError(t, err)
require.True(t, len(evaluations) == 0)
require.Len(t, evaluations, 0)
return
}

Expand Down

0 comments on commit dc7576a

Please sign in to comment.