Merge pull request #78541 from deads2k/timeout

choose a more unique request timeout default
This commit is contained in:
Kubernetes Prow Robot 2019-10-16 20:54:38 -07:00 committed by GitHub
commit eb2deb66e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {