Skip to content

Commit

Permalink
split import in 2
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyGaluzo committed Jan 25, 2025
1 parent d419578 commit 81bf463
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ EXECUTE dbo.MergeResourcesCommitTransaction @TransactionId
public async Task GivenIncrementalLoad_80KSurrogateIds_BadRequestIsReturned()
{
var ndJson = new StringBuilder();
for (int i = 0; i < 80001; i++)
for (int i = 0; i < 79001; i++)
{
var id = Guid.NewGuid().ToString("N");
var str = CreateTestPatient(id, DateTimeOffset.Parse("1900-01-01Z00:00")); // make sure this date is not used by other tests.
Expand All @@ -227,7 +227,21 @@ public async Task GivenIncrementalLoad_80KSurrogateIds_BadRequestIsReturned()
var location = (await ImportTestHelper.UploadFileAsync(ndJson.ToString(), _fixture.StorageAccount)).location;
var request = CreateImportRequest(location, ImportMode.IncrementalLoad);
var checkLocation = await ImportTestHelper.CreateImportTaskAsync(_client, request);
var message = await ImportWaitAsync(checkLocation, false);
await ImportWaitAsync(checkLocation, true);

ndJson = new StringBuilder();
for (int i = 0; i < 1000; i++) // load violators in nlarge batch to avoid large number of retries
{
var id = Guid.NewGuid().ToString("N");
var str = CreateTestPatient(id, DateTimeOffset.Parse("1900-01-01Z00:00")); // make sure this date is not used by other tests.
ndJson.Append(str);
}

location = (await ImportTestHelper.UploadFileAsync(ndJson.ToString(), _fixture.StorageAccount)).location;
request = CreateImportRequest(location, ImportMode.IncrementalLoad);
checkLocation = await ImportTestHelper.CreateImportTaskAsync(_client, request);
var message = await ImportWaitAsync(checkLocation, true);

Assert.Equal(HttpStatusCode.BadRequest, message.StatusCode);
Assert.Contains(ImportProcessingJob.SurrogateIdsErrorMessage, await message.Content.ReadAsStringAsync());
}
Expand Down

0 comments on commit 81bf463

Please sign in to comment.