mirror of
https://github.com/juanfont/headscale.git
synced 2025-10-29 12:07:44 +09:00
integration: rework retry for waiting for node sync
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
committed by
Kristoffer Dalby
parent
9d236571f4
commit
3b16b75fe6
@@ -14,11 +14,27 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/juanfont/headscale/hscontrol/types"
|
||||
"github.com/juanfont/headscale/hscontrol/util"
|
||||
"github.com/juanfont/headscale/integration/dockertestutil"
|
||||
"github.com/ory/dockertest/v3"
|
||||
"github.com/ory/dockertest/v3/docker"
|
||||
)
|
||||
|
||||
// PeerSyncTimeout returns the timeout for peer synchronization based on environment:
|
||||
// 60s for dev, 120s for CI.
|
||||
func PeerSyncTimeout() time.Duration {
|
||||
if util.IsCI() {
|
||||
return 120 * time.Second
|
||||
}
|
||||
return 60 * time.Second
|
||||
}
|
||||
|
||||
// PeerSyncRetryInterval returns the retry interval for peer synchronization checks.
|
||||
func PeerSyncRetryInterval() time.Duration {
|
||||
return 100 * time.Millisecond
|
||||
}
|
||||
|
||||
func WriteFileToContainer(
|
||||
pool *dockertest.Pool,
|
||||
container *dockertest.Resource,
|
||||
|
||||
Reference in New Issue
Block a user