Commit f376b851 authored by Emmanuel T Odeke's avatar Emmanuel T Odeke Committed by Emmanuel Odeke

all: fix invalid invocations of Fatalf in goroutines

Found by running the go vet pass 'testinggoroutine' that
I started in CL 212920.

Change-Id: Ic9462fac85dbafc437fe4a323b886755a67a1efa
Reviewed-on: https://go-review.googlesource.com/c/go/+/213097
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent a65f0883
......@@ -629,7 +629,8 @@ func TestPoolExhaustOnCancel(t *testing.T) {
go func() {
rows, err := db.Query("SELECT|people|name,photo|")
if err != nil {
t.Fatalf("Query: %v", err)
t.Errorf("Query: %v", err)
return
}
rows.Close()
saturateDone.Done()
......@@ -637,6 +638,9 @@ func TestPoolExhaustOnCancel(t *testing.T) {
}
saturate.Wait()
if t.Failed() {
t.FailNow()
}
state = 2
// Now cancel the request while it is waiting.
......
......@@ -998,12 +998,16 @@ func TestConcurrentPreferGoResolversDial(t *testing.T) {
defer wg.Done()
_, err := r.LookupIPAddr(context.Background(), "google.com")
if err != nil {
t.Fatalf("lookup failed for resolver %d: %q", index, err)
t.Errorf("lookup failed for resolver %d: %q", index, err)
}
}(resolver.Resolver, i)
}
wg.Wait()
if t.Failed() {
t.FailNow()
}
for i, resolver := range resolvers {
if !resolver.dialed {
t.Errorf("custom resolver %d not dialed during lookup", i)
......
......@@ -356,7 +356,7 @@ func TestTimerStopStress(t *testing.T) {
for i := 0; i < 100; i++ {
go func(i int) {
timer := AfterFunc(2*Second, func() {
t.Fatalf("timer %d was not stopped", i)
t.Errorf("timer %d was not stopped", i)
})
Sleep(1 * Second)
timer.Stop()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment