Skip to content

Commit

Permalink
Merge pull request #550 from SAP/def_timeout
Browse files Browse the repository at this point in the history
[enc] - update def timeout
  • Loading branch information
ShimiT authored Nov 6, 2019
2 parents a2e30c4 + e603211 commit 2073e9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ func init() {
executeCommand.Flags().StringArrayVarP(&executeCmdCommands,
"commands", "c", nil, "commands to run")
executeCommand.Flags().StringVarP(&executeCmdTimeout,
"timeout", "t", "", "the timeout after which the run stops, in the format [123h][123m][123s]; 5m is set as the default")
"timeout", "t", "", "the timeout after which the run stops, in the format [123h][123m][123s]; 10m is set as the default")
}
2 changes: 1 addition & 1 deletion internal/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func ExecuteWithTimeout(cmdParams [][]string, timeout string, runIndicator bool)

func parseTimeoutString(timeoutString string) (time.Duration, error) {
if timeoutString == "" {
return 5 * time.Minute, nil
return 10 * time.Minute, nil
}
return time.ParseDuration(strings.TrimSpace(timeoutString))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/exec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var _ = Describe("Execute", func() {
Entry("parses timeout with minutes", "10m", "10m0s", false),
Entry("parses timeout with hours", "5h", "5h0m0s", false),
Entry("parses timeout with mixed time units", "10m3s", "10m3s", false),
Entry("returns default timeout when timeout is empty", "", "5m0s", false),
Entry("returns default timeout when timeout is empty", "", "10m0s", false),
Entry("returns error for bad timeout", "abc", "", true),
)

Expand Down

0 comments on commit 2073e9e

Please sign in to comment.