damccorm commented on code in PR #17449:
URL: https://github.com/apache/beam/pull/17449#discussion_r856525412
##########
sdks/go/test/integration/io/xlang/jdbc/jdbc_test.go:
##########
@@ -68,9 +70,23 @@ func setupTestContainer(t *testing.T, ctx context.Context,
dbname, username, pas
},
Started: true,
}
- container, err := testcontainers.GenericContainer(ctx, req)
- if err != nil {
- t.Fatalf("failed to start container: %s", err)
+
+ strategy := retry.LimitCount(maxRetryCount,
+ retry.Exponential{
+ Initial: time.Second,
+ Factor: 2,
+ },
+ )
+ var container testcontainers.Container
+ var err error
+ for r := retry.Start(strategy, nil); r.Next(); {
+ container, err = testcontainers.GenericContainer(ctx, req)
+ if err == nil {
+ break
+ }
+ if r.Count() == maxRetryCount {
+ t.Fatalf("failed to start container: %v", err)
Review Comment:
```suggestion
t.Fatalf("failed to start container with %v retries:
%v", maxRetryCount, err)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]