Skip to content

Commit 355761b

Browse files
authored
Merge pull request #14045 from Abirdcfly/main
fix minor unreachable code caused by t.Fatal
2 parents 6b4de8c + 9bfed78 commit 355761b

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

nomad/structs/structs_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4325,7 +4325,6 @@ func TestTaskArtifact_Validate_Checksum(t *testing.T) {
43254325
err := tc.Input.Validate()
43264326
if (err != nil) != tc.Err {
43274327
t.Fatalf("case %d: %v", i, err)
4328-
continue
43294328
}
43304329
}
43314330
}
@@ -6673,7 +6672,6 @@ func TestNodeReservedNetworkResources_ParseReserved(t *testing.T) {
66736672
out, err := r.ParseReservedHostPorts()
66746673
if (err != nil) != tc.Err {
66756674
t.Fatalf("test case %d: %v", i, err)
6676-
continue
66776675
}
66786676

66796677
require.Equal(out, tc.Parsed)

scheduler/feasible_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ func TestStaticIterator_Reset(t *testing.T) {
3434

3535
out := collectFeasible(static)
3636
if len(out) != len(nodes) {
37-
t.Fatalf("out: %#v", out)
38-
t.Fatalf("missing nodes %d %#v", i, static)
37+
t.Fatalf("out: %#v missing nodes %d %#v", out, i, static)
3938
}
4039

4140
ids := make(map[string]struct{})

scheduler/generic_sched_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ func TestServiceSched_JobRegister(t *testing.T) {
6464

6565
// Ensure the eval has no spawned blocked eval
6666
if len(h.CreateEvals) != 0 {
67-
t.Fatalf("bad: %#v", h.CreateEvals)
67+
t.Errorf("bad: %#v", h.CreateEvals)
6868
if h.Evals[0].BlockedEval != "" {
6969
t.Fatalf("bad: %#v", h.Evals[0])
7070
}
71+
t.FailNow()
7172
}
7273

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

15181519
// Ensure the eval has no spawned blocked eval
15191520
if len(h.Evals) != 1 {
1520-
t.Fatalf("bad: %#v", h.Evals)
1521+
t.Errorf("bad: %#v", h.Evals)
15211522
if h.Evals[0].BlockedEval != "" {
15221523
t.Fatalf("bad: %#v", h.Evals[0])
15231524
}
1525+
t.FailNow()
15241526
}
15251527

15261528
// Ensure the plan allocated

0 commit comments

Comments
 (0)