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
[WIP] Speed up tests by using less threading. #216
Conversation
circuits/core/manager.py
Outdated
@@ -894,6 +894,7 @@ def processTask(self, event, task, parent=None): # noqa | |||
self._eventDone(event) | |||
except KeyboardInterrupt: | |||
self.stop() | |||
raise |
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.
Can you please explain this?
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.
That is mainly for now to let the error bubble up so I can exit pytest quickly (see note2 above)
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.
Hmm this is a bit of a change in behavior ;)
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.
I reverted it, it was not necessary.
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.
I looked through it a bit. I think I added it because it is bad style to swallow keyboard interupts. This way the user cannot hit ctrl+c
to interrupt the program (unless self.stop
does this).
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.
Yes, it should be addressed in a separate issue.
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
=========================================
Coverage ? 77.11%
=========================================
Files ? 80
Lines ? 6658
Branches ? 0
=========================================
Hits ? 5134
Misses ? 1524
Partials ? 0
Continue to review full report at Codecov.
|
@apollo13 Can't we solve this with subclassing and setting |
Hi @spaceone, long time no "see". To be honest I am not using circuits anymore and have no idea what I tried to achieve there (or why I did what I did). Sorry I guess?! :/ |
@apollo13 Alright. Thanks for the feedback. I will do a fix then :-) |
As a comparision: tests/core/test_value.py is down to roughly 1.4 seconds from 3.5 seconds.
abf11de
to
2737bac
Compare
circuits/core/manager.py
Outdated
@@ -894,6 +894,7 @@ def processTask(self, event, task, parent=None): # noqa | |||
self._eventDone(event) | |||
except KeyboardInterrupt: | |||
self.stop() | |||
raise |
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.
Yes, it should be addressed in a separate issue.
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
=======================================
Coverage 75.06% 75.06%
=======================================
Files 84 84
Lines 7135 7135
=======================================
Hits 5356 5356
Misses 1779 1779 Continue to review full report at Codecov.
|
As a comparision: tests/core/test_value.py is down to roughly 1.4
seconds from 3.5 seconds.
Note: I am not good at naming things, so a better name for
exit_after_events
would be coolNote2: I added a re-
raise
to the manager code handling keyboard interrupts, this allows the error to bubble up and actually interrupt pytest -- not sure if that is suitable for the end result, but would be nice to allow for something like this in the longrun.EDIT:// I am not sure to how many tests this can be applied, but it is certainly a nice speed gain if applicable.