-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add tests for actor lifecycle #35
Conversation
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.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
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.
Looks good! I had just a few suggestions.
Maybe you could also check that the event emitting intervals for ActorEventType.PERSIST_STATE
and ActorEventType.SYSTEM_INFO
work correctly, and that they're stopped after Actor.exit()
.
Hint - you can speed them up by setting lower APIFY_PERSIST_STATE_INTERVAL_MILLIS
env var, and lower Actor.config.system_info_interval_millis
config.
Maybe we could make the Actor.config.system_info_interval_millis
also be read from an env var, it would make it a bit more consistent.
Co-authored-by: Jiří Moravčík <[email protected]>
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.
Looks good!
# NOTE: Actor didn't call sys.exit() during testing, check if fail was called. | ||
my_actor.fail.assert_called_with(exit_code=91, _exc_type=type(err), _exc_value=err, _exc_traceback=err.__traceback__) |
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.
Cool!
Tests look quite dummy from the second look, if you have any idea what should we test let me know in PR.