Skip to content

Commit

Permalink
Reordered test so builds we cancelled even on failure. (Also, removed…
Browse files Browse the repository at this point in the history
… some unnecessary usings).
  • Loading branch information
Enkidu93 committed Dec 11, 2023
1 parent 28d3cc2 commit f9a68ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/SIL.DataAccess/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
global using System.Diagnostics.CodeAnalysis;
global using System.Linq.Expressions;
global using System.Reflection;
global using System.Text.Encodings.Web;
global using System.Text.Json;
global using System.Text.Json.Serialization;
global using Microsoft.Extensions.DependencyInjection.Extensions;
global using Microsoft.Extensions.Hosting;
global using Microsoft.Extensions.Options;
Expand Down
22 changes: 9 additions & 13 deletions tests/Serval.E2ETests/ServalApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public async Task NmtQueueMultiple()
{
await _helperClient!.ClearEngines();
const int NUM_ENGINES = 9;
const int NUM_WORKERS = 6;
const int NUM_WORKERS = 1;
string[] engineIds = new string[NUM_ENGINES];
for (int i = 0; i < NUM_ENGINES; i++)
{
Expand Down Expand Up @@ -164,18 +164,8 @@ public async Task NmtQueueMultiple()
TranslationBuild newestEngineCurrentBuild = await _helperClient.translationEnginesClient.GetCurrentBuildAsync(
engineIds[NUM_ENGINES - 1]
);
Assert.NotNull(
newestEngineCurrentBuild.QueueDepth,
JsonSerializer.Serialize(newestEngineCurrentBuild) + "|||" + builds
);
Assert.Multiple(async () =>
{
Assert.That(newestEngineCurrentBuild.QueueDepth, Is.GreaterThan(0), message: builds);
Assert.That(
(await _helperClient.translationEnginesClient.GetQueueAsync("Nmt")).Size,
Is.GreaterThanOrEqualTo(NUM_ENGINES - NUM_WORKERS)
);
});
int? queueDepth = newestEngineCurrentBuild.QueueDepth;
Queue queue = await _helperClient.translationEnginesClient.GetQueueAsync("Nmt");
for (int i = 0; i < NUM_ENGINES; i++)
{
try
Expand All @@ -184,6 +174,12 @@ public async Task NmtQueueMultiple()
}
catch { }
}
Assert.NotNull(queueDepth, JsonSerializer.Serialize(newestEngineCurrentBuild) + "|||" + builds);
Assert.Multiple(() =>
{
Assert.That(queueDepth, Is.GreaterThan(0), message: builds);
Assert.That(queue.Size, Is.GreaterThanOrEqualTo(NUM_ENGINES - NUM_WORKERS));
});
}

[Test]
Expand Down

0 comments on commit f9a68ee

Please sign in to comment.