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

[WIP] Speed up tests by using less threading. #216

Merged
merged 1 commit into from Oct 26, 2020

Conversation

apollo13
Copy link
Contributor

@apollo13 apollo13 commented Jan 27, 2017

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 cool

Note2: 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.

@@ -894,6 +894,7 @@ def processTask(self, event, task, parent=None): # noqa
self._eventDone(event)
except KeyboardInterrupt:
self.stop()
raise
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Member

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 ;)

Copy link
Contributor

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.

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 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).

Copy link
Contributor

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-io
Copy link

codecov-io commented Jan 27, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@7bd87d1).

@@            Coverage Diff            @@
##             master     #216   +/-   ##
=========================================
  Coverage          ?   77.11%           
=========================================
  Files             ?       80           
  Lines             ?     6658           
  Branches          ?        0           
=========================================
  Hits              ?     5134           
  Misses            ?     1524           
  Partials          ?        0
Impacted Files Coverage Δ
circuits/core/manager.py 93.59% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7bd87d1...7543769. Read the comment docs.

@spaceone
Copy link
Contributor

@apollo13 Can't we solve this with subclassing and setting self._running = False in the conftest? So we don't need to add a parameter to circuits which is only required for the tests.

@apollo13
Copy link
Contributor Author

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?! :/

@spaceone
Copy link
Contributor

@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.
@@ -894,6 +894,7 @@ def processTask(self, event, task, parent=None): # noqa
self._eventDone(event)
except KeyboardInterrupt:
self.stop()
raise
Copy link
Contributor

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-io
Copy link

Codecov Report

Merging #216 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ccfa68...2737bac. Read the comment docs.

@spaceone spaceone merged commit cc0a9be into circuits:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants