Merge pull request #43844 from Abirdcfly/master

fix minor code unreachability error
This commit is contained in:
Tianon Gravi 2022-08-12 17:12:15 -07:00 committed by GitHub
commit 8d9d5a3bb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,16 +224,12 @@ func allocate(t *testing.T, tctx *testContext, parallel int64) {
}
if there, ok := tctx.ipMap[ip.String()]; ok && there {
t.Fatalf("Got duplicate IP %s", ip.String())
break
}
tctx.ipList = append(tctx.ipList, ip)
tctx.ipMap[ip.String()] = true
}
assert.Check(t, is.Len(tctx.ipList, tctx.maxIP))
if len(tctx.ipList) != tctx.maxIP {
t.Fatal("mismatch number allocation")
}
assert.Assert(t, is.Len(tctx.ipList, tctx.maxIP))
}
func release(t *testing.T, tctx *testContext, mode releaseMode, parallel int64) {