From 1bb6f49a2640cac8a4755d76ac9535d98449b58a Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Thu, 25 Apr 2024 18:24:49 +0100 Subject: [PATCH] fix(cli): scaletest: ignore errors syncing output --- cli/exp_scaletest.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cli/exp_scaletest.go b/cli/exp_scaletest.go index 3f5468635d934..fe455b9fbd4bf 100644 --- a/cli/exp_scaletest.go +++ b/cli/exp_scaletest.go @@ -14,7 +14,6 @@ import ( "strconv" "strings" "sync" - "syscall" "time" "github.com/google/uuid" @@ -245,14 +244,8 @@ func (o *scaleTestOutput) write(res harness.Results, stdout io.Writer) error { // Sync the file to disk if it's a file. if s, ok := w.(interface{ Sync() error }); ok { - err := s.Sync() - // On Linux, EINVAL is returned when calling fsync on /dev/stdout. We - // can safely ignore this error. - // On macOS, ENOTTY is returned when calling sync on /dev/stdout. We - // can safely ignore this error. - if err != nil && !xerrors.Is(err, syscall.EINVAL) && !xerrors.Is(err, syscall.ENOTTY) { - return xerrors.Errorf("flush output file: %w", err) - } + // Best effort. If we get an error from syncing, just ignore it. + _ = s.Sync() } if c != nil {