Skip to content

Fix thread safety issues#15512

Merged
nohwnd merged 7 commits into
mainfrom
fix/thread-safety-and-xxe-vulnerabilities
Mar 19, 2026
Merged

Fix thread safety issues#15512
nohwnd merged 7 commits into
mainfrom
fix/thread-safety-and-xxe-vulnerabilities

Conversation

@Evangelink
Copy link
Copy Markdown
Member

@Evangelink Evangelink commented Mar 18, 2026

Summary

Several data structures shared across concurrent test execution threads were not thread-safe, risking corrupted results and lost updates.

Changes

  • ParallelRunDataAggregator / DiscoveryDataAggregator: Replace TryGetValue + set pattern with ConcurrentDictionary.AddOrUpdate in metrics aggregation to eliminate lost-update races
  • DataCollectionAttachmentManager: Replace List<Task> with ConcurrentBag<Task> for _attachmentTasks; replace ContainsKey + TryAdd TOCTOU pattern with GetOrAdd for both AttachmentSets and _attachmentTasks
  • BlameCollector: Replace List<Guid> / Dictionary<Guid, BlameTestObject> with ConcurrentQueue / ConcurrentDictionary; use Interlocked.Increment for _testEndCount; snapshot collections before passing to WriteTestSequence
  • TrxLogger / HtmlLogger: Use Interlocked.Increment for all test counters (TotalTestCount, PassedTestCount, FailedTestCount, SkippedTests) to prevent lost updates under concurrent result arrival

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants