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

Simplify LoopService.loop_seconds handling and add debug mode to speedup tests #242

Merged
merged 7 commits into from Apr 14, 2021

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Apr 12, 2021

Summary

  • Removes config key loop_seconds loading
  • Removes __init__``loop_seconds passing
  • Adds getter/setter for loop_seconds
  • Adds loop_seconds_debug that is set during tests by default

Checklist

This PR:

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)

Comment on lines +35 to +36
@property
def loop_seconds(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed some code in the Cloud batch writer that also implements this property which made me feel retaining the _default suffix on loop_seconds was the easiest way to avoid naming collisions. I'll probably rewrite those to call super(). in their default cases.

Comment on lines -19 to -21
# if set, and no `loop_seconds` is provided, the service will attempt to load
# `loop_seconds` from this config key
loop_seconds_config_key = None
Copy link
Contributor Author

@zanieb zanieb Apr 12, 2021

Choose a reason for hiding this comment

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

This feature is unused and is being removed for simplification

# shutdown flag for gracefully exiting the infinite loop
is_running = True

def __init__(self, loop_seconds: Union[float, int] = None):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing loop seconds to __init__ is unused and is being removed for simplification.

jlowin
jlowin previously approved these changes Apr 13, 2021
The tests that we care about speeding up run the services outside pytest :D
@zanieb
Copy link
Contributor Author

zanieb commented Apr 14, 2021

@jlowin I realized that we start services separately from tests in the integration/service test CI steps so I've switched to a different environment variable than the pytest one.

@zanieb zanieb merged commit 1f1386c into master Apr 14, 2021
@zanieb zanieb deleted the loop-service-fix branch April 14, 2021 22:55
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.

None yet

2 participants