diff --git a/pkg/client/node.go b/pkg/client/node.go index 088d71d4..bcf9e8a0 100644 --- a/pkg/client/node.go +++ b/pkg/client/node.go @@ -427,6 +427,13 @@ func NodeWaitForLogMessage(ctx context.Context, runtime runtimes.Runtime, node * for { select { case <-ctx.Done(): + if ctx.Err() == context.DeadlineExceeded { + d, ok := ctx.Deadline() + if ok { + log.Debugf("NodeWaitForLogMessage: Context Deadline (%s) > Current Time (%s)", d, time.Now()) + } + return fmt.Errorf("Context deadline exceeded while waiting for log message '%s' of node %s", message, node.Name) + } return ctx.Err() default: } diff --git a/pkg/runtimes/docker/container.go b/pkg/runtimes/docker/container.go index 6317217b..83fa74f7 100644 --- a/pkg/runtimes/docker/container.go +++ b/pkg/runtimes/docker/container.go @@ -161,8 +161,7 @@ func getNodeContainer(ctx context.Context, node *k3d.Node) (*types.Container, er All: true, }) if err != nil { - log.Errorln("Failed to list containers") - return nil, err + return nil, fmt.Errorf("Failed to list containers: %+v", err) } if len(containers) > 1 { diff --git a/pkg/runtimes/docker/node.go b/pkg/runtimes/docker/node.go index 9bc171fe..21f76f0b 100644 --- a/pkg/runtimes/docker/node.go +++ b/pkg/runtimes/docker/node.go @@ -191,8 +191,7 @@ func getContainersByLabel(ctx context.Context, labels map[string]string) ([]type All: true, }) if err != nil { - log.Errorln("Failed to list containers") - return nil, err + return nil, fmt.Errorf("Failed to list containers: %+v", err) } return containers, nil diff --git a/pkg/runtimes/docker/util.go b/pkg/runtimes/docker/util.go index 7c2a81b7..7bc17e8f 100644 --- a/pkg/runtimes/docker/util.go +++ b/pkg/runtimes/docker/util.go @@ -34,8 +34,8 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" "github.com/docker/docker/pkg/archive" - k3d "github.com/rancher/k3d/v4/pkg/types" "github.com/pkg/errors" + k3d "github.com/rancher/k3d/v4/pkg/types" log "github.com/sirupsen/logrus" ) diff --git a/tests/assets/config_test_simple.yaml b/tests/assets/config_test_simple.yaml index 88386293..cf80cc7e 100644 --- a/tests/assets/config_test_simple.yaml +++ b/tests/assets/config_test_simple.yaml @@ -39,7 +39,7 @@ registries: options: k3d: wait: true - timeout: "60s" + timeout: "360s" # should be pretty high for multi-server clusters to allow for a proper startup routine disableLoadbalancer: false disableImageVolume: false k3s: diff --git a/tests/test_multi_master_start_stop.sh b/tests/test_multi_master_start_stop.sh index f1fab70d..755aff4e 100755 --- a/tests/test_multi_master_start_stop.sh +++ b/tests/test_multi_master_start_stop.sh @@ -34,7 +34,7 @@ info "Waiting for a bit..." sleep 5 info "Restarting cluster (time: $(date -u +"%Y-%m-%d %H:%M:%S %Z"))..." -$EXE cluster start multiserver --timeout 180s || failed "failed to restart cluster (timeout 180s)" +$EXE cluster start multiserver --timeout 360s || failed "failed to restart cluster (timeout 360s)" info "Sleeping for 5 seconds to give the cluster enough time to get ready..." sleep 5