simplify log outputs and increase timeout for tests
This commit is contained in:
parent
98a48a0fc6
commit
ac96c9c448
@ -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:
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
)
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user