From ce302f4a4c2020f89dc5217f9ce399cacce5d9e1 Mon Sep 17 00:00:00 2001 From: Ivan <2103732+codebien@users.noreply.github.com> Date: Tue, 26 Oct 2021 12:23:45 +0200 Subject: [PATCH] cmd: Set the timeout of the cloudapi client --- cmd/cloud.go | 3 ++- cmd/login_cloud.go | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/cloud.go b/cmd/cloud.go index d3c9162cd52..c8b6c756d2d 100644 --- a/cmd/cloud.go +++ b/cmd/cloud.go @@ -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 } diff --git a/cmd/login_cloud.go b/cmd/login_cloud.go index 4c9c843a135..cbd8c42f1da 100644 --- a/cmd/login_cloud.go +++ b/cmd/login_cloud.go @@ -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