From 0e090921ff27e9307daa672d2d5658c6ad667083 Mon Sep 17 00:00:00 2001 From: Matt Serdar <99214729+v-mserdar@users.noreply.github.com> Date: Tue, 2 May 2023 15:15:59 -0700 Subject: [PATCH] adding log output to reindex tests --- .../Features/Operations/Reindex/ReindexJobTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Features/Operations/Reindex/ReindexJobTests.cs b/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Features/Operations/Reindex/ReindexJobTests.cs index f31a7030fc..aec14df869 100644 --- a/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Features/Operations/Reindex/ReindexJobTests.cs +++ b/test/Microsoft.Health.Fhir.Shared.Tests.Integration/Features/Operations/Reindex/ReindexJobTests.cs @@ -45,6 +45,7 @@ using Newtonsoft.Json; using NSubstitute; using Xunit; +using Xunit.Abstractions; using Task = System.Threading.Tasks.Task; namespace Microsoft.Health.Fhir.Tests.Integration.Features.Operations.Reindex @@ -73,6 +74,7 @@ public class ReindexJobTests : IClassFixture, IAsyncLif private SearchParameterStatusManager _searchParameterStatusManager2; private readonly ISearchParameterSupportResolver _searchParameterSupportResolver = Substitute.For(); + private readonly ITestOutputHelper _output; private ReindexJobWorker _reindexJobWorker; private IScoped _searchService; @@ -82,10 +84,11 @@ public class ReindexJobTests : IClassFixture, IAsyncLif private ISearchParameterOperations _searchParameterOperations2 = null; private readonly IDataStoreSearchParameterValidator _dataStoreSearchParameterValidator = Substitute.For(); - public ReindexJobTests(FhirStorageTestsFixture fixture) + public ReindexJobTests(FhirStorageTestsFixture fixture, ITestOutputHelper output) { _fixture = fixture; _testHelper = _fixture.TestHelper; + _output = output; } public async Task InitializeAsync() @@ -838,6 +841,9 @@ private async Task PerformReindexingOperation( } } + var serializer = new FhirJsonSerializer(); + _output.WriteLine(serializer.SerializeToString(reindexJobWrapper.ToParametersResourceElement().ToPoco())); + Assert.True( operationStatus == reindexJobWrapper.JobRecord.Status, $"Current job status '{reindexJobWrapper.JobRecord.Status}'. Expected job status '{operationStatus}'. Number of attempts: {delayCount}. Time elapsed: {stopwatch.Elapsed}.");