mirror of
https://github.com/bitwarden/server
synced 2025-12-17 00:33:23 +00:00
Actually fix flaky test
This commit is contained in:
@@ -88,12 +88,14 @@ public class LoggerFactoryExtensionsTests
|
|||||||
|
|
||||||
logger.LogWarning("This is a test");
|
logger.LogWarning("This is a test");
|
||||||
|
|
||||||
|
await provider.DisposeAsync();
|
||||||
|
|
||||||
// Writing to the file is buffered, give it a little time to flush
|
// Writing to the file is buffered, give it a little time to flush
|
||||||
await Task.Delay(50, TestContext.Current.CancellationToken);
|
await Task.Delay(50, TestContext.Current.CancellationToken);
|
||||||
|
|
||||||
var logFile = Assert.Single(tempDir.EnumerateFiles("Logs/*.log"));
|
var logFile = Assert.Single(tempDir.EnumerateFiles("Logs/*.log"));
|
||||||
|
|
||||||
var logFileContents = await File.ReadAllTextAsync(logFile.FullName);
|
var logFileContents = await File.ReadAllTextAsync(logFile.FullName, TestContext.Current.CancellationToken);
|
||||||
|
|
||||||
Assert.DoesNotContain(
|
Assert.DoesNotContain(
|
||||||
"This configuration location for file logging has been deprecated.",
|
"This configuration location for file logging has been deprecated.",
|
||||||
@@ -166,7 +168,7 @@ public class LoggerFactoryExtensionsTests
|
|||||||
return provider.GetServices<ILoggerProvider>();
|
return provider.GetServices<ILoggerProvider>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IServiceProvider GetServiceProvider(Dictionary<string, string?> initialData, string environment)
|
private static ServiceProvider GetServiceProvider(Dictionary<string, string?> initialData, string environment)
|
||||||
{
|
{
|
||||||
var config = new ConfigurationBuilder()
|
var config = new ConfigurationBuilder()
|
||||||
.AddInMemoryCollection(initialData)
|
.AddInMemoryCollection(initialData)
|
||||||
|
|||||||
Reference in New Issue
Block a user