From 91391d8188a91db1771e02622abe49d0b75b0308 Mon Sep 17 00:00:00 2001 From: Gabriel Pettier Date: Sun, 22 Sep 2019 14:28:40 +0200 Subject: [PATCH] add test for close_all on a receiving server --- .github/workflows/push.yml | 2 +- tests/test_server.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6972225..ebf27fc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -21,7 +21,7 @@ jobs: - name: install run: pip install .[dev,ci] - name: test - run: python -m pytest --reruns 5 tests/ --cov oscpy/ --cov-branch + run: python -m pytest --reruns 2 tests/ --cov oscpy/ --cov-branch - name: coveralls run: python -m coveralls env: diff --git a/tests/test_server.py b/tests/test_server.py index cb111e0..eddd090 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -927,3 +927,16 @@ def callback_3000(*values): assert checklist == ['a', 'b', 'c'] server_3000.stop() # clean up + + +def test_close_receiving(): + osc = OSCThreadServer(encoding='utf8') + osc.listen(default=True) + port = osc.getaddress()[1] + + # this should keep the server busy receiving for a while + for i in range(5000): + send_message(b'/flood', [b't' * 60000], 'localhost', port) + + # surprise, let's stop it asap! + osc.stop_all()