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

feat: add tests for actor lifecycle #35

Merged
merged 3 commits into from
Jan 26, 2023
Merged

Conversation

drobnikj
Copy link
Member

@drobnikj drobnikj commented Jan 25, 2023

Tests look quite dummy from the second look, if you have any idea what should we test let me know in PR.

@github-actions github-actions bot added this to the 55th sprint - Platform team milestone Jan 25, 2023
@github-actions github-actions bot added the t-platform Issues with this label are in the ownership of the platform team. label Jan 25, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Pull Request Tookit has failed!

Pull request is neither linked to an issue or epic nor labeled as adhoc!

Copy link
Member

@fnesveda fnesveda left a 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.

tests/unit/actor/test_actor_lifecycle.py Outdated Show resolved Hide resolved
tests/unit/actor/test_actor_lifecycle.py Show resolved Hide resolved
tests/unit/actor/test_actor_lifecycle.py Outdated Show resolved Hide resolved
tests/unit/actor/test_actor_lifecycle.py Outdated Show resolved Hide resolved
tests/unit/actor/test_actor_lifecycle.py Outdated Show resolved Hide resolved
tests/unit/actor/test_actor_lifecycle.py Outdated Show resolved Hide resolved
@drobnikj drobnikj requested a review from fnesveda January 26, 2023 12:58
Copy link
Member

@fnesveda fnesveda left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines +129 to +130
# 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__)
Copy link
Member

Choose a reason for hiding this comment

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

Cool!

@drobnikj drobnikj merged commit 4674728 into master Jan 26, 2023
@drobnikj drobnikj deleted the feat/actor_lifecycle_tests branch January 26, 2023 14:20
@fnesveda fnesveda added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-platform Issues with this label are in the ownership of the platform team. validated Issues that are resolved and their solutions fulfill the acceptance criteria.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants