Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Sleeps in tests suck #49

Closed
GoogleCodeExporter opened this issue Apr 10, 2015 · 6 comments
Closed

Sleeps in tests suck #49

GoogleCodeExporter opened this issue Apr 10, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Every test that has a sleep or timeout is a potential liability when run on a 
slow or busy system.  We could increase the time to sleep (10 msec is very 
short) but that would make the tests run super slow (they currently take 10 
seconds for ~800 tests, and 60% of that seems to be sleeping).  Maybe we can 
run tests in parallel or have a virtual clock?

Original issue reported on code.google.com by gvanrossum@gmail.com on 6 Aug 2013 at 10:41

@GoogleCodeExporter
Copy link
Author

<off-topic>

> Maybe we can run tests in parallel

Independently from Tulip I think this would be a great addition for the 
unittest module.

Original comment by g.rodola on 6 Aug 2013 at 11:08

@GoogleCodeExporter
Copy link
Author

I think we can avoid the most sleeps by using Future or locks.EventWaiter.
We already do it in test protocols in tests/events_test.py sometimes.

I'll take a look on test improvement.

Original comment by andrew.s...@gmail.com on 8 Aug 2013 at 8:17

@GoogleCodeExporter
Copy link
Author

There is the patch: https://codereview.appspot.com/13090043/

Original comment by andrew.s...@gmail.com on 17 Aug 2013 at 7:40

@GoogleCodeExporter
Copy link
Author

BTW for now (after my patch applied) about 40% of total time eater is 
gc.collect() as I see on profiling results.
We can add option like --no-gc-collect to runtests.py if needed.
Tests run time is 3 secs without gc collection on my laptop.

Original comment by andrew.s...@gmail.com on 17 Aug 2013 at 8:55

@GoogleCodeExporter
Copy link
Author

Pushed

Original comment by andrew.s...@gmail.com on 21 Aug 2013 at 1:59

@GoogleCodeExporter
Copy link
Author

Original comment by andrew.s...@gmail.com on 21 Aug 2013 at 2:00

  • Changed state: Fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant