Skip to content

Commit 2f9908b

Browse files
committed
Fix DynamoDB tests
The latest 'amazon/dynamodb-local' image introduces breaking change and requires dummy credentials, see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html. Without the fix tests fail with the timeout error in DockerSetup.StartContainer method but the real error is "Unable to get IAM security credentials from EC2 Instance Metadata Service." in the DynamoDbDockerSetup.TestReady method.
1 parent 1c199e4 commit 2f9908b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/WorkflowCore.Tests.DynamoDB/DynamoDbDockerSetup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class DynamoDbDockerSetup : DockerSetup
1111
{
1212
public static string ConnectionString { get; set; }
1313

14-
public static AWSCredentials Credentials => new EnvironmentVariablesAWSCredentials();
14+
public static AWSCredentials Credentials => new BasicAWSCredentials("DUMMYIDEXAMPLE", "DUMMYEXAMPLEKEY");
1515

1616
public override string ImageName => @"amazon/dynamodb-local";
1717
public override int InternalPort => 8000;
@@ -30,7 +30,7 @@ public override bool TestReady()
3030
{
3131
ServiceURL = $"http://localhost:{ExternalPort}"
3232
};
33-
AmazonDynamoDBClient client = new AmazonDynamoDBClient(clientConfig);
33+
AmazonDynamoDBClient client = new AmazonDynamoDBClient(Credentials, clientConfig);
3434
var resp = client.ListTablesAsync().Result;
3535

3636
return resp.HttpStatusCode == HttpStatusCode.OK;

0 commit comments

Comments
 (0)