Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
test: go routine errata (#4233)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored Feb 5, 2021
1 parent 00c855f commit eeac22c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions test/e2e/azure/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ func (a *Account) CreateGroupWithRetry(name, location string, sleep, timeout tim
select {
case <-ctx.Done():
return
case ch <- a.CreateGroup(name, location):
default:
ch <- a.CreateGroup(name, location)
time.Sleep(sleep)
}
}
Expand Down Expand Up @@ -200,7 +201,8 @@ func (a *Account) ShowGroupWithRetry(name string, sleep, timeout time.Duration)
select {
case <-ctx.Done():
return
case ch <- a.ShowGroup(name):
default:
ch <- a.ShowGroup(name)
time.Sleep(sleep)
}
}
Expand Down Expand Up @@ -387,7 +389,8 @@ func (a *Account) GetRGRouteTable(timeout time.Duration) (network.RouteTable, er
select {
case <-ctx.Done():
return
case ch <- a.ListRGRouteTable():
default:
ch <- a.ListRGRouteTable()
time.Sleep(5 * time.Second)
}
}
Expand Down
9 changes: 6 additions & 3 deletions test/e2e/remote/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ func NewConnectionWithRetry(host, port, user, keyPath string, sleep, timeout tim
select {
case <-ctx.Done():
return
case ch <- NewConnectionAsync(host, port, user, keyPath):
default:
ch <- NewConnectionAsync(host, port, user, keyPath)
time.Sleep(sleep)
}
}
Expand Down Expand Up @@ -241,7 +242,8 @@ func (c *Connection) CopyToRemoteWithRetry(hostname, path string, sleep, timeout
select {
case <-ctx.Done():
return
case ch <- c.CopyToRemote(hostname, path):
default:
ch <- c.CopyToRemote(hostname, path)
time.Sleep(sleep)
}
}
Expand Down Expand Up @@ -285,7 +287,8 @@ func (c *Connection) ExecuteRemoteWithRetry(node, command string, printStdout bo
select {
case <-ctx.Done():
return
case ch <- c.ExecuteRemote(node, command, printStdout):
default:
ch <- c.ExecuteRemote(node, command, printStdout)
time.Sleep(sleep)
}
}
Expand Down

0 comments on commit eeac22c

Please sign in to comment.