Extend rsync command timeout in tests. (#33661)

This commit is contained in:
Brian Joerger 2023-10-18 15:45:59 -07:00 committed by GitHub
parent ba3e630a7d
commit 053615057f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -477,14 +477,16 @@ func TestWithRsync(t *testing.T) {
require.NoError(t, err)
dstPath := filepath.Join(testDir, "dst")
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
t.Cleanup(cancel)
cmd := tt.createCmd(ctx, testDir, srcPath, dstPath)
out, err := cmd.CombinedOutput()
err := cmd.Run()
var msg string
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
msg = fmt.Sprintf("exit code: %d\nout: %s", exitErr.ExitCode(), out)
msg = fmt.Sprintf("exit code: %d", exitErr.ExitCode())
msg += fmt.Sprintf("stderr: %s", exitErr.Stderr)
}
require.NoError(t, err, msg)