From b2d45c3dd03475f6483adcf323ab6d6d55172269 Mon Sep 17 00:00:00 2001 From: Stephen Halter Date: Mon, 21 Nov 2016 12:09:47 -0800 Subject: [PATCH] Make TestApplicationErrorLogger thread-safe --- test/shared/TestApplicationErrorLogger.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/shared/TestApplicationErrorLogger.cs b/test/shared/TestApplicationErrorLogger.cs index 5036f1cec9..80c12a23bd 100644 --- a/test/shared/TestApplicationErrorLogger.cs +++ b/test/shared/TestApplicationErrorLogger.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; +using System.Collections.Concurrent; using System.Linq; using Microsoft.AspNetCore.Server.Kestrel.Internal; using Microsoft.Extensions.Logging; @@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Testing // Application errors are logged using 13 as the eventId. private const int ApplicationErrorEventId = 13; - public List Messages { get; } = new List(); + public ConcurrentBag Messages { get; } = new ConcurrentBag(); public int TotalErrorsLogged => Messages.Count(message => message.LogLevel == LogLevel.Error);