Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awsdms: further deflake roachtest #83400

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions pkg/cmd/roachtest/tests/awsdms.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,22 +487,55 @@ func setupDMSEndpointsAndTask(
}
*ep.arn = *epOut.Endpoint.EndpointArn

// Test the connections to see if they are "successful".
// If not, any subsequence DMS task will fail to startup.
t.L().Printf("testing replication endpoint %s", *ep.in.EndpointIdentifier)
if _, err := dmsCli.TestConnection(ctx, &dms.TestConnectionInput{
EndpointArn: epOut.Endpoint.EndpointArn,
ReplicationInstanceArn: proto.String(replicationARN),
}); err != nil {
return errors.Wrapf(err, "error initiating a test connection")
}
r := retry.StartWithCtx(ctx, retry.Options{
InitialBackoff: 30 * time.Second,
MaxBackoff: time.Minute,
MaxRetries: 10,
})
var lastErr error
for r.Next() {
_, lastErr = dmsCli.TestConnection(ctx, &dms.TestConnectionInput{
EndpointArn: epOut.Endpoint.EndpointArn,
ReplicationInstanceArn: proto.String(replicationARN),
})
if lastErr == nil {
if lastErr = func() error {
result, err := dmsCli.DescribeConnections(
ctx,
&dms.DescribeConnectionsInput{
Filters: []dmstypes.Filter{
{
Name: proto.String("endpoint-arn"),
Values: []string{*epOut.Endpoint.EndpointArn},
},
},
},
)
if err != nil {
return err
}
if len(result.Connections) != 1 {
return errors.AssertionFailedf("expected exactly one connection during DescribeConnections, found %d", len(result.Connections))
}
conn := result.Connections[0]
if *conn.Status == "successful" {
return nil
}
retErr := errors.Newf(
"replication test on %s not successful (%s)",
*ep.in.EndpointIdentifier,
*conn.Status,
)
return retErr
}(); lastErr == nil {
break
} else {
t.L().Printf("replication endpoint test failed, retrying: %s", lastErr)
}
t.L().Printf("replication endpoint test failed, retrying: %s", lastErr)
}
if lastErr != nil {
return lastErr
Expand Down