Skip to content

Only call adjust_total_time once#347

Merged
emilylin0 merged 1 commit into
mainfrom
el/fix_total_time
Feb 23, 2023
Merged

Only call adjust_total_time once#347
emilylin0 merged 1 commit into
mainfrom
el/fix_total_time

Conversation

@emilylin0
Copy link
Copy Markdown
Contributor

Previously, I introduced a PR that caused total_time to be updated if a job is interrupted, fails, or succeeds.

However, this also introduced a bug where if the job is interrupted, adjust_total_time is actually called twice- once in the ensure statement of the iterate_with_enumerator method and again in the reenqueue_iteration_job method, resulting in incorrect total_time since the current iteration's runtime would be double-counted

I added a new test where a job is interrupted, and verified that total_time is correct after the interruption.

Previously, a PR was introduced that caused `total_time` to be updated
if a job is interrupted, fails, or succeeds. However, this also
introduced a bug where if the job is interrupted, adjust_total_time
is actually called twice- once in the `ensure` statement of the
`iterate_with_enumerator` method and again in the `reenqueue_iteration_job`
method, resulting in incorrect `total_time` since the current iteration's
runtime would be double-counted
Copy link
Copy Markdown

@iamrestrepo iamrestrepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎊 Thanks!

@emilylin0 emilylin0 merged commit 58347c6 into main Feb 23, 2023
@emilylin0 emilylin0 deleted the el/fix_total_time branch February 23, 2023 16:33
@shopify-shipit shopify-shipit Bot temporarily deployed to rubygems February 26, 2023 14:32 Inactive
@lavoiesl lavoiesl mentioned this pull request Aug 15, 2023
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