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

is_first_decorator can be flaky #15

Closed
felixnext opened this issue Jan 22, 2023 · 1 comment · Fixed by #10
Closed

is_first_decorator can be flaky #15

felixnext opened this issue Jan 22, 2023 · 1 comment · Fixed by #10
Assignees
Labels
bug Something isn't working

Comments

@felixnext
Copy link
Owner

When many decorators are used in parallel (in unittests for example) the is_first_decorator system can be flaky (maybe due to collisions in the id(func) space?).

This forced to enable the removal of variable keyword parameters to all function signatures in BaseDecorator. This is not ideal and should be fixed! (In that case shield the variable keyword removal again for only the function in is_first_decorator.

Note that this adjustment has to happen after the __increase_count call in line 199:

self.__increase_count(id(self.func), id(execute))

@felixnext felixnext added the bug Something isn't working label Jan 22, 2023
@felixnext felixnext self-assigned this Jan 22, 2023
@felixnext felixnext linked a pull request Jan 24, 2023 that will close this issue
@felixnext
Copy link
Owner Author

This is reduced with #10 - Reason was non safe multithreadedness

This can still happen in Unit-Tests that are parameterized (since they access the same underlying function that is decorated, therefore generating the same base id. Therefore all unit tests are now executed with --forked command to ensure isolation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant