-
Notifications
You must be signed in to change notification settings - Fork 36
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
[OASIS-7827] fix: make _get_time() value the same throughout the loop #356
Conversation
optimizely/event/event_processor.py
Outdated
@@ -180,14 +180,15 @@ def _run(self): | |||
""" | |||
try: | |||
while True: | |||
if self._get_time() >= self.flushing_interval_deadline: | |||
loop_time = self._get_time() | |||
if loop_time >= self.flushing_interval_deadline: | |||
self._flush_batch() | |||
self.flushing_interval_deadline = self._get_time() + \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this ._get_time() to loop_time as well? - line 186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking about that yes. Thx for the pointer. Will implement and test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me. Noting that FSC will not pass till Config V2 is merged in. All other tests appear to pass which is good. Also noting to wait to merge till V2 Config is merged so we have a clean set of checks on this PR before merging.
Summary
Test plan
Unit tests for the _run() function where the change is made already extensively cover the _run() and event processor functionality.
The change itself should prevent negative interval from occurring. To test that a larger load test would be required.
Issues