Skip to content

Commit

Permalink
Check for github_actions env and increase timeout
Browse files Browse the repository at this point in the history
Signed-off-by: மனோஜ்குமார் பழனிச்சாமி <[email protected]>
  • Loading branch information
SmartManoj committed Jul 9, 2024
1 parent 463ed82 commit da9b66c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/networks/usernet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"net"
"net/http"
"os"
"time"

gvproxyclient "github.com/containers/gvisor-tap-vsock/pkg/client"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit da9b66c

Please sign in to comment.