mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-11 23:17:36 +00:00
give ci more tollerance for timeouts
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:

committed by
Kristoffer Dalby

parent
432e975a7f
commit
2434d76ade
@@ -1,6 +1,7 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -131,6 +132,38 @@ func isSelfClient(client TailscaleClient, addr string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func isCI() bool {
|
||||
if _, ok := os.LookupEnv("CI"); ok {
|
||||
return true
|
||||
}
|
||||
|
||||
if _, ok := os.LookupEnv("GITHUB_RUN_ID"); ok {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func dockertestMaxWait() time.Duration {
|
||||
wait := 60 * time.Second //nolint
|
||||
|
||||
if isCI() {
|
||||
wait = 300 * time.Second //nolint
|
||||
}
|
||||
|
||||
return wait
|
||||
}
|
||||
|
||||
// func dockertestCommandTimeout() time.Duration {
|
||||
// timeout := 10 * time.Second //nolint
|
||||
//
|
||||
// if isCI() {
|
||||
// timeout = 60 * time.Second //nolint
|
||||
// }
|
||||
//
|
||||
// return timeout
|
||||
// }
|
||||
|
||||
// pingAllNegativeHelper is intended to have 1 or more nodes timeing out from the ping,
|
||||
// it counts failures instead of successes.
|
||||
// func pingAllNegativeHelper(t *testing.T, clients []TailscaleClient, addrs []string) int {
|
||||
|
Reference in New Issue
Block a user