-
-
Notifications
You must be signed in to change notification settings - Fork 15
test: Add large-scale pipeline tests (100+ modules) #2022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add comprehensive scale tests to validate pipeline behavior with many modules: - 100 independent modules running in parallel - 50-deep dependency chain (sequential execution) - Fan-out pattern (1 root + 50 dependents) - Fan-in pattern (50 independent + 1 final) These tests verify that the pipeline engine handles large numbers of modules correctly, including proper parallelization, dependency ordering, and resource management. Closes #2002 Co-Authored-By: Claude Opus 4.5 <[email protected]>
SummaryThis PR adds large-scale pipeline tests to verify scalability with 100+ modules across 4 test scenarios: independent modules, deep chains, fan-out, and fan-in patterns. Critical Issues1. Static mutable state causes test isolation issues The ExecutionTracker uses static fields that are shared across all test instances. While Reset() is called at the beginning of each test, this creates a race condition risk. Tests are marked with [NotInParallel] to prevent parallel execution, but static state violates test isolation principles. Recommendation: Consider using instance-level tracking or test-scoped services via dependency injection instead of static state. 2. Missing test cleanup verification The tests verify CompletedCount matches expected counts, but don't verify that the ExecutionTracker was properly reset between tests. If a test fails mid-execution, the next test might see stale state. Suggestions1. Add validation for dependency ordering in chain test The test Pipeline_With50ModuleDeepChain_CompletesInOrder should verify that modules actually execute in sequential order (Chain1 before Chain2, etc.), not just that all 50 complete. 2. Consider performance/timing assertions For scale tests, it would be valuable to assert that parallel tests complete significantly faster than serial equivalents. 3. Add test for error propagation at scale Consider adding a test where one module in a large chain fails to verify that failure handling works correctly at scale. Verdict |
- Convert ExecutionTracker from static to instance-based for proper test isolation - Add IsClean property for verifying tracker state before tests - Add TotalRecordedCount property for tracking all recorded modules - Add dependency ordering validation in chain test - Fix DependsOn attribute to use fully qualified name to avoid TUnit conflict Co-Authored-By: Claude Opus 4.5 <[email protected]>
SummaryAdds comprehensive scale testing for ModularPipelines with 100+ module scenarios testing independent execution, dependency chains, fan-out, and fan-in patterns. Critical IssuesNone found ✅ Previous Review StatusThe previous review raised concerns about static mutable state. Reviewing the current code: ✅ RESOLVED: ExecutionTracker uses instance-level state, not static
The static concern appears to have been based on a misreading or has since been fixed. ✅ Test isolation: Each test creates its own tracker instance, ensuring proper isolation Suggestions1. Add dependency ordering validation in chain test (line 323) The deep chain test verifies all 50 modules complete but doesn't validate sequential execution order. Consider adding: // Verify sequential execution order
for (int i = 1; i < 50; i++)
{
var current = tracker.GetRecord($"Chain{i}");
var next = tracker.GetRecord($"Chain{i+1}");
await Assert.That(current!.EndTime).IsLessThanOrEqualTo(next!.StartTime);
}This would verify Chain1 completes before Chain2 starts, validating dependency enforcement. 2. Minor: ChainModule classes are repetitive (lines 227-290) 625 lines of nearly-identical module class definitions could be simplified with source generators or reflection-based module creation. However, for test code clarity and debuggability, explicit definitions may be preferable. Verdict✅ APPROVE - No critical issues, well-designed scale tests with proper isolation |
Summary
Closes #2002
🤖 Generated with Claude Code