Skip to content

Commit df4d495

Browse files
committed
tests: fix flaky TestGracefulShutdown
Updated list of skippable exec errors. Closes #529
1 parent 05c868a commit df4d495

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

test_helpers/main.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"os/exec"
2222
"path/filepath"
2323
"regexp"
24+
"slices"
2425
"strconv"
2526
"strings"
2627
"time"
@@ -237,15 +238,27 @@ func IsTarantoolVersionLess(majorMin uint64, minorMin uint64, patchMin uint64) (
237238
var major, minor, patch uint64
238239

239240
var (
240-
out []byte
241-
err error
241+
out []byte
242+
err error
243+
skip_errors = []string{
244+
"bad file descriptor",
245+
"broken pipe",
246+
}
242247
)
243248
for range 10 {
244249
out, err = exec.Command(getTarantoolExec(), "--version").Output()
245-
if err == nil || !strings.Contains(err.Error(), "bad file descriptor") {
250+
251+
if err == nil && len(out) > 0 {
252+
break
253+
}
254+
255+
if !slices.ContainsFunc(skip_errors, func(e string) bool {
256+
return strings.Contains(err.Error(), e)
257+
}) {
246258
break
247259
}
248-
// Skip "bad file descriptor" error and try again.
260+
261+
// Skip error and try again.
249262
// For unknown reason it sometimes happens on CI.
250263
time.Sleep(time.Second)
251264
}

0 commit comments

Comments
 (0)