diff options
author | Lachlan Sylvester <lachlan.sylvester@hypothetical.com.au> | 2015-10-17 00:44:12 +1100 |
---|---|---|
committer | Lachlan Sylvester <lachlan.sylvester@hypothetical.com.au> | 2015-10-17 00:46:11 +1100 |
commit | 5efd82dbe5307982c1eac3ada7a2478993fd59be (patch) | |
tree | d8f30b4776d8dc07fdd1b962c183669d29e3a850 /test/connection/string_identifier_test.rb | |
parent | e456d734f70de3dfb245c2d2e3ce9c7e22ebdb71 (diff) | |
download | rails-5efd82dbe5307982c1eac3ada7a2478993fd59be.tar.gz rails-5efd82dbe5307982c1eac3ada7a2478993fd59be.tar.bz2 rails-5efd82dbe5307982c1eac3ada7a2478993fd59be.zip |
Speed up tests be calling EM.run_deferred_callbacks instead of setting a timer
The run_in_eventmachine test helper method is setting a 0.1 second timer to stop the event machine loop. This causes each test that requires an event machine loop to wait for 0.1 second regardless of how long the test takes to process.
This changes that to call EM.run_deferred_callbacks, which immediatly process pending actions in the event loop and then is able to exit the event loop without doing any waiting.
Before this change, running tests produced
Finished in 2.957857s, 15.8899 runs/s, 27.7228 assertions/s.
After, the tests get
Finished in 0.065942s, 712.7514 runs/s, 1243.5237 assertions/s.
Diffstat (limited to 'test/connection/string_identifier_test.rb')
0 files changed, 0 insertions, 0 deletions