From 15ff36effbb4e15c89d2cc9073276ec458065683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Vall=C3=A9n?= Date: Thu, 16 Jul 2026 12:32:31 +0200 Subject: [PATCH] Serialize SelfLog-sharing tests to fix intermittent CarriesMessageTemplateProperties failure --- .../Seq/Extensions/Logging/EnricherTests.cs | 1 + .../Serilog/Extensions/Logging/SerilogLoggerTests.cs | 1 + .../Support/SelfLogCollection.cs | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 test/Seq.Extensions.Logging.Tests/Support/SelfLogCollection.cs diff --git a/test/Seq.Extensions.Logging.Tests/Seq/Extensions/Logging/EnricherTests.cs b/test/Seq.Extensions.Logging.Tests/Seq/Extensions/Logging/EnricherTests.cs index 18e64fd..b492ed7 100644 --- a/test/Seq.Extensions.Logging.Tests/Seq/Extensions/Logging/EnricherTests.cs +++ b/test/Seq.Extensions.Logging.Tests/Seq/Extensions/Logging/EnricherTests.cs @@ -6,6 +6,7 @@ namespace Tests.Seq.Extensions.Logging; +[Collection("SelfLog")] public class EnricherTests { [Fact] diff --git a/test/Seq.Extensions.Logging.Tests/Serilog/Extensions/Logging/SerilogLoggerTests.cs b/test/Seq.Extensions.Logging.Tests/Serilog/Extensions/Logging/SerilogLoggerTests.cs index fe7ac69..f2973bc 100644 --- a/test/Seq.Extensions.Logging.Tests/Serilog/Extensions/Logging/SerilogLoggerTests.cs +++ b/test/Seq.Extensions.Logging.Tests/Serilog/Extensions/Logging/SerilogLoggerTests.cs @@ -13,6 +13,7 @@ namespace Tests.Serilog.Extensions.Logging; +[Collection("SelfLog")] public class SerilogLoggerTests { static SerilogLoggerTests() diff --git a/test/Seq.Extensions.Logging.Tests/Support/SelfLogCollection.cs b/test/Seq.Extensions.Logging.Tests/Support/SelfLogCollection.cs new file mode 100644 index 0000000..0ed12f4 --- /dev/null +++ b/test/Seq.Extensions.Logging.Tests/Support/SelfLogCollection.cs @@ -0,0 +1,12 @@ +using Xunit; + +namespace Tests.Support; + +/// +/// Tests in this collection share the process-global SelfLog state +/// (a single static output sink). Running them in parallel causes writes from +/// one test to be observed by another, producing spurious failures, so the +/// collection is serialized. +/// +[CollectionDefinition("SelfLog", DisableParallelization = true)] +public class SelfLogCollection { } \ No newline at end of file