[Notifications] Fix missed notifications in notifications pusher #3607
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding a fix to
_push_terminal_run_notifications
._last_notification_push_time
was calculated after querying and pushing all runs, therefore a run could have been missed. Taking the time now before running the query.This change lead to some scheduler tests taking longer and fail.
We computed a margin of
0.5
seconds for these tests, which was already quite insufficient (0.4
is not enough), and increased it to0.8
in this PR.It looks like adding even one CPU-consuming code line along the flow will cause a delay in the run time.
This margin will only work temporarily, and we don't want this actions to influence the run time. In the future, we should consider separating this server code, but for now, we should discuss a better solution (maybe make scheduler tests not run the periodic run monitor + add a test for the real flow expected time).