Skip to content

Commit 365231b

Browse files
authored
fix(cli): scaletest: ignore errors syncing output (coder#13076)
1 parent 74f2771 commit 365231b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

cli/exp_scaletest.go

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"strconv"
1515
"strings"
1616
"sync"
17-
"syscall"
1817
"time"
1918

2019
"github.com/google/uuid"
@@ -245,14 +244,8 @@ func (o *scaleTestOutput) write(res harness.Results, stdout io.Writer) error {
245244

246245
// Sync the file to disk if it's a file.
247246
if s, ok := w.(interface{ Sync() error }); ok {
248-
err := s.Sync()
249-
// On Linux, EINVAL is returned when calling fsync on /dev/stdout. We
250-
// can safely ignore this error.
251-
// On macOS, ENOTTY is returned when calling sync on /dev/stdout. We
252-
// can safely ignore this error.
253-
if err != nil && !xerrors.Is(err, syscall.EINVAL) && !xerrors.Is(err, syscall.ENOTTY) {
254-
return xerrors.Errorf("flush output file: %w", err)
255-
}
247+
// Best effort. If we get an error from syncing, just ignore it.
248+
_ = s.Sync()
256249
}
257250

258251
if c != nil {

0 commit comments

Comments
 (0)