refactor: Consolidate NotInParallel and shell test patterns#1687
Conversation
- Create NotInParallelTestModule base class for NotInParallel tests - Create NotInParallelTracker using ConcurrentDictionary (avoids ConcurrentBag flaky issue) - Create ModuleResultAssertions.AssertCommandOutput() for shell test assertions - Update BashTests, CmdTests, PowershellTests to use shared assertions - Update NotInParallel test files to use shared base class Fixes #1592 Fixes #1564 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SummaryRefactors test code to reduce duplication by introducing assertion helpers and base classes for NotInParallel tests, while fixing a concurrency bug in the tracking mechanism. Critical IssuesNone found ✅ This PR actually fixes a bug in the original code where SuggestionsNotInParallelTestModule.cs:90 - Minor optimization opportunityThe while (_violations.TryTake(out _)) { }Since General observationThe refactoring significantly improves code maintainability by:
Verdict✅ APPROVE - No critical issues. The PR improves code quality and fixes a concurrency bug. |
Summary
NotInParallelTestModulebase class in TestHelpers for NotInParallel testsNotInParallelTrackerusingConcurrentDictionary(avoids the ConcurrentBag.TryTake flaky issue)ModuleResultAssertions.AssertCommandOutput()for shell test assertionsFixes #1592, #1564
Test plan
🤖 Generated with Claude Code