From 13eefc6ff36e5520d248ed4afca513f609abcfab Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Tue, 21 Apr 2020 09:55:36 +0100 Subject: [PATCH] Add retry to read model delete --- .../Common/DockerHelper.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs index ad04589f..345666f3 100644 --- a/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs +++ b/TransactionProcessor.IntegrationTests/Common/DockerHelper.cs @@ -377,10 +377,13 @@ private async Task RemoveEstateReadModel() { String databaseName = $"EstateReportingReadModel{estateId}"; - // Build the connection string (to master) - String connectionString = Setup.GetLocalConnectionString(databaseName); - EstateReportingContext context = new EstateReportingContext(connectionString); - await context.Database.EnsureDeletedAsync(CancellationToken.None); + await Retry.For(async () => + { + // Build the connection string (to master) + String connectionString = Setup.GetLocalConnectionString(databaseName); + EstateReportingContext context = new EstateReportingContext(connectionString); + await context.Database.EnsureDeletedAsync(CancellationToken.None); + }); } }