-
-
Notifications
You must be signed in to change notification settings - Fork 108
perf: convert synchronous TestStateManager methods to void #4312
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
Conversation
- Convert TestStateManager methods from Task-returning to void since they are purely synchronous in-memory operations: - MarkRunningAsync → MarkRunning - MarkCompletedAsync → MarkCompleted - MarkFailedAsync → MarkFailed - MarkSkippedAsync → MarkSkipped - MarkCircularDependencyFailedAsync → MarkCircularDependencyFailed - MarkDependencyResolutionFailedAsync → MarkDependencyResolutionFailed - Make InProgress message fire-and-forget in TestCoordinator since it's informational and doesn't need to block test execution Benefits: - Eliminates async state machine overhead at call sites - Zero allocation for synchronous operations (no Task.CompletedTask) - Cleaner API that accurately represents synchronous nature of operations Co-Authored-By: Claude Opus 4.5 <[email protected]>
SummaryConverts synchronous TestStateManager methods from Task-returning to void to eliminate async overhead. Critical IssuesFire-and-forget pattern introduces potential issues (TestCoordinator.cs:65) The change to fire-and-forget for InProgress messages introduces several problems:
Recommendation: Keep the await for InProgress. The performance gain is negligible compared to the reliability risk. SuggestionsThe TestStateManager void conversion itself is good - these are genuinely synchronous operations. VerdictREQUEST CHANGES - Fire-and-forget pattern needs to be addressed |
Summary
Task-returning tovoidsince they are purely synchronous in-memory operationsInProgressmessage fire-and-forget in TestCoordinator since it's informational and doesn't need to block test executionChanges
MarkRunningAsyncMarkRunningMarkCompletedAsyncMarkCompletedMarkFailedAsyncMarkFailedMarkSkippedAsyncMarkSkippedMarkCircularDependencyFailedAsyncMarkCircularDependencyFailedMarkDependencyResolutionFailedAsyncMarkDependencyResolutionFailedBenefits
Task.CompletedTask)Test plan
🤖 Generated with Claude Code