mopidy/tests
Thomas Adamcik 4ee7dd73bd http: Make WS broadcast more robust against disconnect race
Adds some WebSocketHandler tests that actually connect using a WS client and
plugs a potential race condition.

Any call to write_message could fail, either due to WebSocketClosedError like
in the log below, or simply due to socket errors. To play it safe we catch all
errors and debug log that a broadcast failed.

2015-02-26 21:24:02,266 ERROR    [HttpServer] /home/adamcik/dev/mopidy/mopidy/http/handlers.py:116
  mopidy.http.handlers WebSocket request error: deque index out of range
2015-02-26 21:24:10,098 ERROR    [HttpFrontend-11] build/bdist.linux-x86_64/egg/pykka/actor.py:268
  pykka Unhandled exception in HttpFrontend (urn:uuid:e376bd95-c32e-4e17-ad20-7d0b3c0cf2b2):
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "build/bdist.linux-x86_64/egg/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File ".../dev/mopidy/mopidy/http/actor.py", line 77, in on_event
    on_event(name, **data)
  File ".../dev/mopidy/mopidy/http/actor.py", line 84, in on_event
    handlers.WebSocketHandler.broadcast(message)
  File ".../dev/mopidy/mopidy/http/handlers.py", line 78, in broadcast
    client.write_message(msg)
  File ".../dev/mopidy-virtualenv/local/lib/python2.7/site-packages/tornado/websocket.py", line 183, in write_message
    raise WebSocketClosedError()
WebSocketClosedError
2015-03-02 00:05:21 +01:00
..
audio audio: Move DummyAudio into tests package 2015-02-13 10:40:21 +01:00
backend Improve default get_images() implementation with album/artist URIs. 2015-02-27 22:22:28 +01:00
config config: Convert the loglevel schema to a generic map schema 2015-02-25 21:36:59 +01:00
core backend: Move DummyBackend into tests package 2015-02-13 01:37:07 +01:00
data tests: Cleanup find tests to use tempfile all over. 2014-10-15 23:45:27 +02:00
http http: Make WS broadcast more robust against disconnect race 2015-03-02 00:05:21 +01:00
local Merge pull request #999 from tkem/fix/998 2015-02-25 21:05:53 +01:00
mpd mpd: Support blacklisting MPD commands in the server. 2015-02-18 00:13:24 +01:00
stream stream: Hook stream scanner up to proxy settings 2015-02-13 00:52:20 +01:00
utils backend: Move DummyBackend into tests package 2015-02-13 01:37:07 +01:00
__init__.py flake8: Fix new warnings after flake8 upgrade 2015-02-07 17:11:36 +01:00
__main__.py py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
dummy_audio.py audio: Move DummyAudio into tests package 2015-02-13 10:40:21 +01:00
dummy_backend.py backend: Move DummyBackend into tests package 2015-02-13 01:37:07 +01:00
dummy_mixer.py mixer: Move DummyMixer into tests package 2015-02-13 01:37:07 +01:00
test_commands.py tests: Add noqa markers for setUp/tearDown 2014-12-30 00:23:01 +01:00
test_exceptions.py utils: Switch to exceptions.FindError for errors. 2014-12-14 14:08:45 +01:00
test_ext.py tests: Add noqa markers for setUp/tearDown 2014-12-30 00:23:01 +01:00
test_help.py py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
test_mixer.py tests: Add noqa markers for setUp/tearDown 2014-12-30 00:23:01 +01:00
test_models.py tests: Re-add incorrectly removed test case 2015-02-12 23:08:27 +01:00
test_version.py tests: Fix versions test pep8 naming errors 2014-12-29 23:48:59 +01:00