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.
  • Loading branch information
stevenh committed Aug 13, 2024
1 parent ff35f85 commit f9b3996
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 {
Logger.Printf("XXX: too many requests: %+v", cfg)
}
}
return c, fmt.Errorf("create container: %w", err)
}

Expand Down

0 comments on commit f9b3996

Please sign in to comment.