From ee4d9ade27cb7ecb66bda70734b18bdac82ee1ee Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 17 Jul 2019 06:07:37 +0000 Subject: [PATCH] #1773 don't run for too long, just wait for a few packets git-svn-id: https://xpra.org/svn/Xpra/trunk@23171 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/unittests/unit/client/mixins/audioclient_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/unittests/unit/client/mixins/audioclient_test.py b/src/unittests/unit/client/mixins/audioclient_test.py index 864bae17aa..19c395ab8f 100755 --- a/src/unittests/unit/client/mixins/audioclient_test.py +++ b/src/unittests/unit/client/mixins/audioclient_test.py @@ -38,11 +38,21 @@ def test_audio(self): def stop(): self.mixin.stop_sending_sound() self.stop() + def check_packets(): + if len(self.packets)<5: + return True + self.mixin.stop_sending_sound() + self.main_loop.quit() + return False + self.glib.timeout_add(100, check_packets) self.glib.timeout_add(5000, stop) #self.debug_all() x.parse_server_capabilities() self.main_loop.run() assert len(self.packets)>2 + from xpra.os_util import get_util_logger + for p in self.packets: + get_util_logger().info("%s", p) self.verify_packet(0, ("sound-data", )) assert self.packets[0][3].get("start-of-stream"), "start-of-stream not found" self.verify_packet(-1, ("sound-data", ))