Skip to content

Commit

Permalink
runtime: Fixing --v1-compatible runtime REPL test (#6546)
Browse files Browse the repository at this point in the history
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
  • Loading branch information
johanfylling authored Jan 25, 2024
1 parent 56d2707 commit 848b7d9
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,22 @@ p contains 1 if {
t.Fatal(err)
}

if !test.Eventually(t, 5*time.Second, func() bool {
if tc.expErrs != nil {
return strings.Contains(output.String(), "# reload error")
if tc.expErrs != nil {
if !test.Eventually(t, 5*time.Second, func() bool {
for _, expErr := range tc.expErrs {
if !strings.Contains(output.String(), expErr) {
return false
}
}
return true
}) {
t.Fatalf("Expected error(s):\n\n%v\n\ngot output:\n\n%s", tc.expErrs, output.String())
}
return strings.Contains(output.String(), "# reloaded files")
}) {
t.Fatal("Timed out waiting for watcher")
}

for _, expErr := range tc.expErrs {
if !strings.Contains(output.String(), expErr) {
t.Fatalf("Expected error:\n\n%v\n\ngot output:\n\n%s", expErr, output.String())
} else {
if !test.Eventually(t, 5*time.Second, func() bool {
return strings.Contains(output.String(), "# reloaded files")
}) {
t.Fatal("Timed out waiting for watcher")
}
}
})
Expand Down

0 comments on commit 848b7d9

Please sign in to comment.