From da9b66cf497cc171b72eda9ccdf719c5b31d8119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Tue, 9 Jul 2024 11:08:59 +0530 Subject: [PATCH] Check for github_actions env and increase timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: மனோஜ்குமார் பழனிச்சாமி --- pkg/networks/usernet/client.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/networks/usernet/client.go b/pkg/networks/usernet/client.go index adc035391b19..b0a3c59cb4fa 100644 --- a/pkg/networks/usernet/client.go +++ b/pkg/networks/usernet/client.go @@ -7,6 +7,7 @@ import ( "fmt" "net" "net/http" + "os" "time" gvproxyclient "github.com/containers/gvisor-tap-vsock/pkg/client" @@ -74,11 +75,15 @@ func (c *Client) ResolveAndForwardSSH(ipAddr string, sshPort int) error { } func (c *Client) ResolveIPAddress(ctx context.Context, vmMacAddr string) (string, error) { - timeout := time.After(2 * time.Minute) + timeout := 2 * time.Minute + if os.Getenv("GITHUB_ACTIONS") != "" { + timeout = 3 * time.Minute + } + timeoutChan := time.After(timeout) ticker := time.NewTicker(500 * time.Millisecond) for { select { - case <-timeout: + case <-timeoutChan: return "", errors.New("usernet unable to resolve IP for SSH forwarding") case <-ticker.C: leases, err := c.Leases(ctx)