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

DEVPROD-7550: fix calculating next stop time when editing schedule #7918

Conversation

Kimchelly
Copy link
Contributor

@Kimchelly Kimchelly commented May 23, 2024

DEVPROD-7550

Description

Fix a bug where the sleep schedule's next stop time might be bumped too far in the future because the next start time is set on the schedule first. Both next start and next stop should be based on the current moment. For example, if it's 3pm right now and the user sets the host to a 9am - 5pm schedule, the next stop should logically be at 5pm today. However, the prior logic would set the next stop to 5pm tomorrow because it looked for a next stop time after the next start time (which is at 9am tomorrow).

Testing

Added unit test.

Documentation

N/A

@Kimchelly Kimchelly requested a review from a team May 23, 2024 20:51
// calculating both the next start and next stop times. If the next start
// time is set first on the schedule, the next stop time can be pushed
// further into the future than necessary.
// kim: TODO: add test for next stop set based on now rather than next
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be ticketed or removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops this was already added to the tests. I removed the comment.

@Kimchelly Kimchelly requested a review from hadjri May 28, 2024 16:47
@Kimchelly Kimchelly merged commit ed3026c into evergreen-ci:main May 28, 2024
8 checks passed
@Kimchelly Kimchelly deleted the DEVPROD-7550_fix_edit_schedule_next_stop_time branch May 28, 2024 17:52
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.

2 participants