chore(e2e): increase ucind cluster init timeouts, decrease max backoff delay for TCP connection to retry faster

This commit is contained in:
Pasha Sviderski
2026-04-09 14:39:12 +10:00
parent cd149e4506
commit b3b33a82ba
4 changed files with 16 additions and 5 deletions
+3 -3
View File
@@ -125,7 +125,7 @@ func (p *Provisioner) initCluster(ctx context.Context, machines []Machine) error
}
defer initClient.Close()
if err := initClient.WaitMachineReady(ctx, 30*time.Second); err != nil {
if err := initClient.WaitMachineReady(ctx, 90*time.Second); err != nil {
return fmt.Errorf("wait for machine %q to be ready: %w", initMachine.Name, err)
}
@@ -140,7 +140,7 @@ func (p *Provisioner) initCluster(ctx context.Context, machines []Machine) error
fmt.Printf("Cluster %q initialised with machine %q\n", initMachine.ClusterName, initResp.Machine.Name)
fmt.Printf("Waiting for cluster to be ready...")
if err = initClient.WaitClusterReady(ctx, 30*time.Second); err != nil {
if err = initClient.WaitClusterReady(ctx, 90*time.Second); err != nil {
return fmt.Errorf("wait for cluster to be ready: %w", err)
}
fmt.Println(" done.")
@@ -160,7 +160,7 @@ func (p *Provisioner) initCluster(ctx context.Context, machines []Machine) error
//goland:noinspection GoDeferInLoop
defer cli.Close()
if err := cli.WaitMachineReady(ctx, 30*time.Second); err != nil {
if err := cli.WaitMachineReady(ctx, 90*time.Second); err != nil {
return fmt.Errorf("wait for machine %q to be ready: %w", m.Name, err)
}
+11
View File
@@ -4,10 +4,12 @@ import (
"context"
"fmt"
"net/netip"
"time"
"github.com/psviderski/uncloud/internal/grpcversion"
"golang.org/x/net/proxy"
"google.golang.org/grpc"
"google.golang.org/grpc/backoff"
"google.golang.org/grpc/credentials/insecure"
)
@@ -21,10 +23,19 @@ func NewTCPConnector(apiAddr netip.AddrPort) *TCPConnector {
}
func (c *TCPConnector) Connect(_ context.Context) (*grpc.ClientConn, error) {
// Use a faster connection backoff than the default (which grows up to 120s). TCP connections are typically to
// local Docker containers (ucind) or LAN machines where long backoff delays are unnecessary.
backoffConfig := backoff.DefaultConfig
backoffConfig.MaxDelay = 5 * time.Second
conn, err := grpc.NewClient(
c.apiAddr.String(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(defaultServiceConfig),
grpc.WithConnectParams(grpc.ConnectParams{
Backoff: backoffConfig,
MinConnectTimeout: 5 * time.Second,
}),
grpc.WithUnaryInterceptor(grpcversion.ClientUnaryInterceptor),
grpc.WithStreamInterceptor(grpcversion.ClientStreamInterceptor),
)
+1 -1
View File
@@ -25,7 +25,7 @@ trap cleanup INT TERM EXIT
dind dockerd &
echo "Waiting for Docker in Docker to be ready..."
timeout 5s sh -c "until docker info &> /dev/null; do sleep 0.1; done"
timeout 60s sh -c "until docker info &> /dev/null; do sleep 0.5; done"
echo "Docker in Docker is ready."
echo "Loading corrosion image from /images/corrosion.tar..."
+1 -1
View File
@@ -55,7 +55,7 @@ func createTestCluster(
})
if waitReady {
require.NoError(t, p.WaitClusterReady(ctx, c, 60*time.Second))
require.NoError(t, p.WaitClusterReady(ctx, c, 90*time.Second))
}
return c, p