Skip to content
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

fix(taskgroup): failed group tasks not counted #85

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

alitto
Copy link
Owner

@alitto alitto commented Nov 13, 2024

This pull request includes changes to the group.go file to improve task submission handling and adds new test cases to ensure the functionality of task group metrics and handling of cancelled contexts.

Improvements to task submission:

  • Changed the submit function to use g.pool.dispatcher.Write for task execution, which returns an error if the context is cancelled or an error occurs during task invocation. (group.go, group.goL107-R115)
  • Added a return statement to ensure the error is properly returned after task completion. (group.go, group.goR125-R126)

New test cases:

  • Added TestTaskGroupMetrics to verify the correct reporting of submitted, successful, and failed tasks. (group_test.go, group_test.goR326-R371)
  • Added TestTaskGroupMetricsWithCancelledContext to test the behavior of task groups when the context is cancelled, ensuring accurate metrics for successful and failed tasks. (group_test.go, group_test.goR326-R371)

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.11%. Comparing base (543ed3a) to head (688b02c).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #85   +/-   ##
=======================================
  Coverage   96.10%   96.11%           
=======================================
  Files          14       14           
  Lines         847      849    +2     
=======================================
+ Hits          814      816    +2     
  Misses         30       30           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alitto alitto force-pushed the fix/AD/group-metrics branch from 1235694 to 964210f Compare November 13, 2024 14:53
@alitto alitto force-pushed the fix/AD/group-metrics branch from 964210f to 688b02c Compare November 13, 2024 14:58
@alitto alitto merged commit 9f8d16a into main Nov 13, 2024
9 checks passed
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.

1 participant