1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

17 commits

Author SHA1 Message Date
David Heinemeier Hansson
bf40bddfce Get ready to merge into Rails 2015-12-14 15:48:54 +01:00
Pratik Naik
84b1f0a3e6 Send subscription confirmation from server to the client to avoid race conditions.
Without this, it's very easy to send messages over a subscription even before the
redis pubsub has been fully initialized.

Now we delay calling the subscription#connected method on the client side until we
receive a subscription confirmation message from the server.
2015-10-16 21:11:21 -05:00
Jeremy Daer
9a8824fb5e Merge pull request #97 from lsylvester/speed-up-tests
Speed up tests be calling EM.run_deferred_callbacks instead of setting a timer
2015-10-16 09:11:45 -07:00
Jeremy Daer
acfdcf5568 Devolve blanket #require to reveal intent and responsibility
* Move specific requires close to where they're needed.
* Use the private active_support/rails dep to wrap up common needs
  like eager autoload and module delegation.
* Use a single Rails engine rather than an engine and a railtie.
* Prefer `AS::JSON.encode` to `Object#to_json`.
2015-10-16 09:06:44 -07:00
Lachlan Sylvester
5efd82dbe5 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.
2015-10-17 00:46:11 +11:00
Jeremy Daer
4d6f1b0cbe Shush some low-hanging Ruby warnings 2015-10-16 00:32:46 -07:00
Jeremy Daer
0dc7f80177 Websockets -> WebSocket spelling [ci skip] 2015-10-15 23:25:54 -07:00
Pratik Naik
ee16ca8990 Run connection tests in EM loop 2015-10-15 21:11:49 -05:00
Thomas Walpole
5d8c848273 Update gems and requires 2015-07-22 14:54:48 -07:00
Pratik Naik
b75bff4225 Worker tests 2015-07-14 10:58:46 -05:00
Pratik Naik
05b760d959 Remove busted tests 2015-07-13 15:00:27 -05:00
Pratik Naik
e1da6814b4 Always load all the stub files 2015-07-13 11:30:52 -05:00
Pratik Naik
1af531dcf7 Add some more tests 2015-07-12 11:44:56 -05:00
Pratik Naik
f207245cc7 Load mocha for tests 2015-07-12 11:44:56 -05:00
Pratik Naik
6e1b5877de Dont create the test log file 2015-02-13 17:29:26 +05:30
Pratik Naik
7fef6b01a3 No cramp and use celluloid workers to run callbacks 2015-02-05 16:35:11 +05:30
Pratik Naik
843492ee6c Add some tests. Work in progress. Testing websockets is hard. 2015-01-15 22:58:02 +05:30