choose a more unique request timeout default

This commit is contained in:
David Eads 2019-05-30 15:17:40 -04:00
parent 064458de46
commit e1dd9af894
2 changed files with 4 additions and 3 deletions

View File

@ -409,7 +409,8 @@ func parseTimeout(str string) time.Duration {
}
klog.Errorf("Failed to parse %q: %v", str, err)
}
return 30 * time.Second
// 34 chose as a number close to 30 that is likely to be unique enough to jump out at me the next time I see a timeout. Everyone chooses 30.
return 34 * time.Second
}
func isDryRun(url *url.URL) bool {

View File

@ -826,10 +826,10 @@ func TestHasUID(t *testing.T) {
}
func TestParseTimeout(t *testing.T) {
if d := parseTimeout(""); d != 30*time.Second {
if d := parseTimeout(""); d != 34*time.Second {
t.Errorf("blank timeout produces %v", d)
}
if d := parseTimeout("not a timeout"); d != 30*time.Second {
if d := parseTimeout("not a timeout"); d != 34*time.Second {
t.Errorf("bad timeout produces %v", d)
}
if d := parseTimeout("10s"); d != 10*time.Second {