Skip to content

Commit

Permalink
no goroutine exit now that we don't goroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 28, 2024
1 parent 6177c18 commit d371f98
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions flow/e2e/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"log/slog"
"runtime"
"slices"
"strings"
"testing"
Expand Down Expand Up @@ -53,19 +52,17 @@ func EnvNoError(t *testing.T, env WorkflowRun, err error) {
t.Helper()

if err != nil {
t.Error("UNEXPECTED ERROR", err.Error())
env.Cancel()
runtime.Goexit()
t.Fatal("UNEXPECTED ERROR", err.Error())
}
}

func EnvTrue(t *testing.T, env WorkflowRun, val bool) {
t.Helper()

if !val {
t.Error("UNEXPECTED FALSE")
env.Cancel()
runtime.Goexit()
t.Fatal("UNEXPECTED FALSE")
}
}

Expand Down Expand Up @@ -179,9 +176,8 @@ func SetupCDCFlowStatusQuery(t *testing.T, env WorkflowRun, connectionGen FlowCo
return
}
} else if counter > 15 {
t.Error("UNEXPECTED SETUP CDC TIMEOUT", err.Error())
env.Cancel()
runtime.Goexit()
t.Fatal("UNEXPECTED SETUP CDC TIMEOUT", err.Error())
} else if counter > 5 {
// log the error for informational purposes
t.Log(err.Error())
Expand Down Expand Up @@ -633,9 +629,8 @@ func EnvWaitFor(t *testing.T, env WorkflowRun, timeout time.Duration, reason str
deadline := time.Now().Add(timeout)
for !f() {
if time.Now().After(deadline) {
t.Error("UNEXPECTED TIMEOUT", reason, time.Now())
env.Cancel()
runtime.Goexit()
t.Fatal("UNEXPECTED TIMEOUT", reason, time.Now())
}
time.Sleep(time.Second)
}
Expand Down

0 comments on commit d371f98

Please sign in to comment.