Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix minor unreachable code caused by t.Fatal #14045

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions nomad/structs/structs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4321,7 +4321,6 @@ func TestTaskArtifact_Validate_Checksum(t *testing.T) {
err := tc.Input.Validate()
if (err != nil) != tc.Err {
t.Fatalf("case %d: %v", i, err)
continue
}
}
}
Expand Down Expand Up @@ -6669,7 +6668,6 @@ func TestNodeReservedNetworkResources_ParseReserved(t *testing.T) {
out, err := r.ParseReservedHostPorts()
if (err != nil) != tc.Err {
t.Fatalf("test case %d: %v", i, err)
continue
}

require.Equal(out, tc.Parsed)
Expand Down
3 changes: 1 addition & 2 deletions scheduler/feasible_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ func TestStaticIterator_Reset(t *testing.T) {

out := collectFeasible(static)
if len(out) != len(nodes) {
t.Fatalf("out: %#v", out)
t.Fatalf("missing nodes %d %#v", i, static)
t.Fatalf("out: %#v missing nodes %d %#v", out, i, static)
}

ids := make(map[string]struct{})
Expand Down
6 changes: 4 additions & 2 deletions scheduler/generic_sched_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ func TestServiceSched_JobRegister(t *testing.T) {

// Ensure the eval has no spawned blocked eval
if len(h.CreateEvals) != 0 {
t.Fatalf("bad: %#v", h.CreateEvals)
t.Errorf("bad: %#v", h.CreateEvals)
if h.Evals[0].BlockedEval != "" {
t.Fatalf("bad: %#v", h.Evals[0])
}
t.FailNow()
}

// Ensure the plan allocated
Expand Down Expand Up @@ -1517,10 +1518,11 @@ func TestServiceSched_EvaluateBlockedEval_Finished(t *testing.T) {

// Ensure the eval has no spawned blocked eval
if len(h.Evals) != 1 {
t.Fatalf("bad: %#v", h.Evals)
t.Errorf("bad: %#v", h.Evals)
if h.Evals[0].BlockedEval != "" {
t.Fatalf("bad: %#v", h.Evals[0])
}
t.FailNow()
}

// Ensure the plan allocated
Expand Down