fix minor unreachable code caused by t.Fatal

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
This commit is contained in:
Abirdcfly
2022-08-08 17:26:08 +08:00
parent 279631eeb5
commit 9bfed7893a
3 changed files with 5 additions and 6 deletions

View File

@@ -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
}
}
}
@@ -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)

View File

@@ -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{})

View File

@@ -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
@@ -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