diff --git a/src/InformaticsGateway/Test/Services/Connectors/PayloadAssemblerTest.cs b/src/InformaticsGateway/Test/Services/Connectors/PayloadAssemblerTest.cs index cf1baecfc..290906ca3 100644 --- a/src/InformaticsGateway/Test/Services/Connectors/PayloadAssemblerTest.cs +++ b/src/InformaticsGateway/Test/Services/Connectors/PayloadAssemblerTest.cs @@ -74,7 +74,7 @@ public void GivenAPayloadAssembler_WhenInitialized_ExpectParametersToBeValidated Assert.Throws(() => new PayloadAssembler(_options, _logger.Object, null)); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAFileStorageMetadata_WhenQueueingWihtoutSpecifyingATimeout_ExpectDefaultTimeoutToBeUsed() { var payloadAssembler = new PayloadAssembler(_options, _logger.Object, _serviceScopeFactory.Object); @@ -88,7 +88,7 @@ public async Task GivenAFileStorageMetadata_WhenQueueingWihtoutSpecifyingATimeou _cancellationTokenSource.Cancel(); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenFileStorageMetadataInTheDatabase_AtServiceStartup_ExpectPayloadsInCreatedStateToBeRemoved() { var dataset = new List @@ -110,7 +110,7 @@ public async Task GivenFileStorageMetadataInTheDatabase_AtServiceStartup_ExpectP _repository.Verify(p => p.Remove(It.IsAny()), Times.Exactly(2)); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAPayloadAssembler_WhenDisposed_ExpectResourceToBeCleanedUp() { var payloadAssembler = new PayloadAssembler(_options, _logger.Object, _serviceScopeFactory.Object); @@ -126,7 +126,7 @@ public async Task GivenAPayloadAssembler_WhenDisposed_ExpectResourceToBeCleanedU _logger.VerifyLoggingMessageBeginsWith($"Number of collections in queue", LogLevel.Trace, Times.Never()); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenFileStorageMetadata_WhenQueueingWithDatabaseError_ExpectToRetryXTimes() { int callCount = 0; @@ -152,7 +152,7 @@ public async Task GivenFileStorageMetadata_WhenQueueingWithDatabaseError_ExpectT _logger.VerifyLoggingMessageBeginsWith($"Number of buckets active: 1.", LogLevel.Trace, Times.AtLeastOnce()); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAPayloadThatHasNotCompleteUploads_WhenProcessedByTimedEvent_ExpectToBeAddedToQueue() { _repository.Setup(p => p.SaveChangesAsync(It.IsAny())).Callback(() => @@ -171,7 +171,7 @@ public async Task GivenAPayloadThatHasNotCompleteUploads_WhenProcessedByTimedEve _logger.VerifyLoggingMessageBeginsWith($"Bucket A sent to processing queue", LogLevel.Information, Times.Never()); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAPayloadThatHasCompletedUploads_WhenProcessedByTimedEvent_ExpectToBeAddedToQueue() { var payloadAssembler = new PayloadAssembler(_options, _logger.Object, _serviceScopeFactory.Object); diff --git a/src/InformaticsGateway/Test/Services/Connectors/PayloadMoveActionHandlerTest.cs b/src/InformaticsGateway/Test/Services/Connectors/PayloadMoveActionHandlerTest.cs index f3b2c1a33..1c8434245 100644 --- a/src/InformaticsGateway/Test/Services/Connectors/PayloadMoveActionHandlerTest.cs +++ b/src/InformaticsGateway/Test/Services/Connectors/PayloadMoveActionHandlerTest.cs @@ -70,7 +70,7 @@ public PayloadMoveActionHandlerTest() _options.Value.Storage.StorageServiceBucketName = "bucket"; } - [RetryFact] + [RetryFact(10,200)] public void GivenAPayloadMoveActionHandler_WhenInitialized_ExpectParametersToBeValidated() { Assert.Throws(() => new PayloadMoveActionHandler(null, null, null)); @@ -80,7 +80,7 @@ public void GivenAPayloadMoveActionHandler_WhenInitialized_ExpectParametersToBeV _ = new PayloadMoveActionHandler(_serviceScopeFactory.Object, _logger.Object, _options); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAPayloadInIncorrectState_WhenHandlerIsCalled_ExpectExceptionToBeThrown() { var resetEvent = new ManualResetEventSlim(); @@ -144,7 +144,7 @@ public async Task GivenAPayload_WhenHandlerFailedToCopyFiles_ExpectToBePutBackIn Assert.Equal(retryCount + 1, payload.RetryCount); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAPayloadThatHasReachedMaximumRetries_WhenHandlerFailedToCopyFiles_ExpectPayloadToBeDeleted() { var moveAction = new ActionBlock(payload => @@ -175,7 +175,7 @@ public async Task GivenAPayloadThatHasReachedMaximumRetries_WhenHandlerFailedToC _repository.Verify(p => p.Remove(payload), Times.Once()); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAPayload_WhenAllFilesAreMove_ExpectPayloadToBeAddedToNotificationQueue() { var notifyEvent = new ManualResetEventSlim(); diff --git a/src/InformaticsGateway/Test/Services/Connectors/PayloadNotificationServiceTest.cs b/src/InformaticsGateway/Test/Services/Connectors/PayloadNotificationServiceTest.cs index 21cc120ab..a67307b17 100644 --- a/src/InformaticsGateway/Test/Services/Connectors/PayloadNotificationServiceTest.cs +++ b/src/InformaticsGateway/Test/Services/Connectors/PayloadNotificationServiceTest.cs @@ -85,7 +85,7 @@ public PayloadNotificationServiceTest() _logger.Setup(p => p.IsEnabled(It.IsAny())).Returns(true); } - [RetryFact] + [RetryFact(10,200)] public void GivenAPayloadNotificationService_AtInitialization_ExpectParametersToBeValidated() { Assert.Throws(() => new PayloadNotificationService(null, null, null)); @@ -93,7 +93,7 @@ public void GivenAPayloadNotificationService_AtInitialization_ExpectParametersTo Assert.Throws(() => new PayloadNotificationService(_serviceScopeFactory.Object, _logger.Object, null)); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenThePayloadNotificationService_WhenStopAsyncIsCalled_ExpectServiceToStopAnyProcessing() { var payload = new Payload("test", Guid.NewGuid().ToString(), 100) { State = Payload.PayloadState.Move }; @@ -116,7 +116,7 @@ public async Task GivenThePayloadNotificationService_WhenStopAsyncIsCalled_Expec _logger.VerifyLogging($"Uploading payload {payload.Id} to storage service at {_options.Value.Storage.StorageServiceBucketName}.", LogLevel.Information, Times.Never()); } - [RetryFact] + [RetryFact(10,200)] public void GivenPayloadsStoredInTheDatabase_WhenServiceStarts_ExpectThePayloadsToBeRestored() { var testData = new List @@ -139,7 +139,7 @@ public void GivenPayloadsStoredInTheDatabase_WhenServiceStarts_ExpectThePayloads _payloadNotificationActionHandler.Verify(p => p.NotifyAsync(It.IsAny(), It.IsAny>(), It.IsAny()), Times.AtLeastOnce()); } - [RetryFact] + [RetryFact(10,200)] public void GivenAPayload_WhenDequedFromPayloadAssemblerAndFailedToBeProcessByTheMoveActionHandler() { var resetEvent = new ManualResetEventSlim(); @@ -157,7 +157,7 @@ public void GivenAPayload_WhenDequedFromPayloadAssemblerAndFailedToBeProcessByTh resetEvent.Wait(); } - [RetryFact] + [RetryFact(10,200)] public void GivenAPayload_WhenDequedFromPayloadAssembler_ExpectThePayloadBeProcessedByTheMoveActionHandler() { var payload = new Payload("test", Guid.NewGuid().ToString(), 100) { State = Payload.PayloadState.Move }; diff --git a/src/InformaticsGateway/Test/Services/Fhir/FhirServiceTest.cs b/src/InformaticsGateway/Test/Services/Fhir/FhirServiceTest.cs index 95d61d121..c4ccb736d 100644 --- a/src/InformaticsGateway/Test/Services/Fhir/FhirServiceTest.cs +++ b/src/InformaticsGateway/Test/Services/Fhir/FhirServiceTest.cs @@ -85,7 +85,7 @@ public FhirServiceTest() _options.Value.Storage.TemporaryDataStorage = TemporaryDataStorageLocation.Memory; } - [RetryFact] + [RetryFact(10,200)] public void GivenAFhirService_WhenInitialized_ExpectParametersToBeValidated() { Assert.Throws(() => new FhirService(null, null)); @@ -94,7 +94,7 @@ public void GivenAFhirService_WhenInitialized_ExpectParametersToBeValidated() new FhirService(_serviceScopeFactory.Object, _options); } - [RetryFact] + [RetryFact(10,200)] public async Task StoreAsync_WhenCalled_ShallValidateParametersAsync() { var correlationId = Guid.NewGuid().ToString(); diff --git a/src/InformaticsGateway/Test/Services/Scu/ScuServiceTest.cs b/src/InformaticsGateway/Test/Services/Scu/ScuServiceTest.cs index 11b563b01..13444945c 100644 --- a/src/InformaticsGateway/Test/Services/Scu/ScuServiceTest.cs +++ b/src/InformaticsGateway/Test/Services/Scu/ScuServiceTest.cs @@ -71,7 +71,7 @@ public ScuServiceTest(DicomScpFixture dicomScp) _dicomScp.Start(_port); } - [RetryFact] + [RetryFact(10,200)] public void GivenAScuService_WhenInitialized_ExpectParametersToBeValidated() { Assert.Throws(() => new ScuService(null, null, null)); @@ -80,7 +80,7 @@ public void GivenAScuService_WhenInitialized_ExpectParametersToBeValidated() _ = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options); } - [RetryFact] + [RetryFact(10,200)] public void GivenAScuService_WhenStartAsyncIsCalled_ExpectServiceStatusToBeSet() { var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options); @@ -89,7 +89,7 @@ public void GivenAScuService_WhenStartAsyncIsCalled_ExpectServiceStatusToBeSet() Assert.Equal(ServiceStatus.Running, svc.Status); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenAValidDicomEntity_WhenRequestToCEcho_ExpectToReturnSucess() { var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options); @@ -106,7 +106,7 @@ public async Task GivenAValidDicomEntity_WhenRequestToCEcho_ExpectToReturnSucess Assert.Empty(response.Message); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenACEchoRequest_WhenRejected_ReturnStatusAssociationRejected() { var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options); @@ -123,7 +123,7 @@ public async Task GivenACEchoRequest_WhenRejected_ReturnStatusAssociationRejecte Assert.StartsWith("Association rejected", response.Message); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenACEchoRequest_WhenAborted_ReturnStatusAssociationAborted() { var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options); @@ -140,7 +140,7 @@ public async Task GivenACEchoRequest_WhenAborted_ReturnStatusAssociationAborted( Assert.StartsWith("Association Abort", response.Message); } - [RetryFact] + [RetryFact(10,200)] public async Task GivenACEchoRequest_WhenRemoteServerIsUnreachable_ReturnStatusAssociationRejected() { var svc = new ScuService(_serviceScopeFactory.Object, _logger.Object, _options);