Skip to content

Commit

Permalink
debugging: rate limit config dump
Browse files Browse the repository at this point in the history
Add output of the docker config if we hit rate limiting to aid in
debugging why this is happening on github actions.

Don't use logger as that's no-op when verbose is not in effect.
  • Loading branch information
stevenh committed Aug 14, 2024
1 parent d5cc09d commit 95accc4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"strings"
"sync"

"github.com/testcontainers/testcontainers-go/internal/core"
Expand Down Expand Up @@ -74,6 +75,14 @@ func GenericContainer(ctx context.Context, req GenericContainerRequest) (Contain
}
if err != nil {
// At this point `c` might not be nil. Give the caller an opportunity to call Destroy on the container.
// TODO: Remove this debugging.
if strings.Contains(err.Error(), "toomanyrequests") {
// Debugging information for rate limiting.
cfg, err := getDockerConfig()
if err == nil {
fmt.Printf("XXX: too many requests: %+v", cfg)
}
}
return c, fmt.Errorf("create container: %w", err)
}

Expand Down

0 comments on commit 95accc4

Please sign in to comment.