diff --git a/tests/Titano.Server.Tests/Api/AdminTests.cs b/tests/Titano.Server.Tests/Api/AdminTests.cs index 2f8b00e8..3de0b7fe 100644 --- a/tests/Titano.Server.Tests/Api/AdminTests.cs +++ b/tests/Titano.Server.Tests/Api/AdminTests.cs @@ -4,6 +4,7 @@ using System.Text.Json.Nodes; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Titano.Protocol; +using Titano.Server.Hosting; using Titano.Testing; namespace Titano.Server.Tests.Api; @@ -75,13 +76,14 @@ public sealed class AdminTests(TestContext context) var admin = await server.AdminAsync(); using var files = await admin.GetAsync("/api/v1/logs/files"); var name = (await files.ReadAsync(ProtocolJson.Default.ListLogFileDto)).First().Name; - var logger = server.Services.GetRequiredService().CreateLogger("Titano.Server.Tests"); + // Jobs, uploads and sign-ins keep writing to the file an administrator downloads. Only to the file: a flood on + // the console would hold up the loggers of the tests running alongside. + var logger = server.Services.GetServices().OfType().Single().CreateLogger("Titano.Server.Tests"); using var stop = new CancellationTokenSource(); - // Jobs, uploads and sign-ins keep writing to the file an administrator downloads. - var logging = Task.Run(() => + var logging = Task.Factory.StartNew(() => { while (!stop.IsCancellationRequested) logger.LogInformation("Busy"); - }); + }, TaskCreationOptions.LongRunning); try { for (var i = 0; i < 5; i++)