diff --git a/TUnit.Core/TestContext.Output.cs b/TUnit.Core/TestContext.Output.cs index c3a1f2f0f3..6d41e43787 100644 --- a/TUnit.Core/TestContext.Output.cs +++ b/TUnit.Core/TestContext.Output.cs @@ -12,24 +12,8 @@ public partial class TestContext // Internal backing fields and properties internal ConcurrentBag Timings { get; } = []; private readonly ConcurrentBag _artifactsBag = new(); - private List? _cachedArtifactsList; - private int _artifactsVersion = 0; - internal IReadOnlyList Artifacts - { - get - { - // Simple version check - if bag hasn't changed, return cached list - if (_cachedArtifactsList != null && _artifactsVersion == _artifactsBag.Count) - { - return _cachedArtifactsList; - } - - _cachedArtifactsList = _artifactsBag.ToList(); - _artifactsVersion = _artifactsBag.Count; - return _cachedArtifactsList; - } - } + internal IReadOnlyList Artifacts => _artifactsBag.ToList(); // Explicit interface implementations for ITestOutput TextWriter ITestOutput.StandardOutput => OutputWriter; @@ -45,7 +29,6 @@ void ITestOutput.RecordTiming(Timing timing) void ITestOutput.AttachArtifact(Artifact artifact) { _artifactsBag.Add(artifact); - _artifactsVersion++; // Invalidate cache } string ITestOutput.GetStandardOutput() => GetOutput();