Skip to content

Commit

Permalink
cmd: Set the timeout of the cloudapi client
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed Oct 27, 2021
1 parent 183db89 commit ce302f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/cloud.go
Expand Up @@ -199,7 +199,8 @@ This will execute the test on the k6 cloud service. Use "k6 login cloud" to auth

// Start cloud test run
modifyAndPrintBar(progressBar, pb.WithConstProgress(0, "Validating script options"))
client := cloudapi.NewClient(logger, cloudConfig.Token.String, cloudConfig.Host.String, consts.Version)
client := cloudapi.NewClient(
logger, cloudConfig.Token.String, cloudConfig.Host.String, consts.Version, cloudConfig.Timeout.TimeDuration())
if err = client.ValidateOptions(arc.Options); err != nil {
return err
}
Expand Down
8 changes: 7 additions & 1 deletion cmd/login_cloud.go
Expand Up @@ -118,7 +118,13 @@ This will set the default token used when just "k6 run -o cloud" is passed.`,
email := vals["Email"].(string)
password := vals["Password"].(string)

client := cloudapi.NewClient(logger, "", consolidatedCurrentConfig.Host.String, consts.Version)
client := cloudapi.NewClient(
logger,
"",
consolidatedCurrentConfig.Host.String,
consts.Version,
consolidatedCurrentConfig.Timeout.TimeDuration())

res, err := client.Login(email, password)
if err != nil {
return err
Expand Down

0 comments on commit ce302f4

Please sign in to comment.