The twisted tests framework in Gabble listens on tcp port 4242 to simulate a Jabber server. If an application unrelated to unit tests already listens on that port, the tests fail. The tests could be made more resistant by trying another port if 4242 is busy. The attached patch on tests/twisted/gabbletest.py fixes the bug for most tests. More work is needed for some tests such as connect/test-fail.py.
Created attachment 60607 [details] [review] [PATCH 1/2] Tests: use another tcp port if 4242 is already used
Created attachment 60608 [details] [review] [PATCH 2/2] Don't use "localhost" for listening: name resolution is not working This patch is useful when /etc/hosts does not contain the following line: 127.0.0.1 localhost I used it to be able to run tests on some computer where I couldn't fix /etc/hosts... I don't know if it worth merging that upstream tbh, but here is the patch :)
Wouldn't it be better to listenTCP() first, and make_connection afterwards? Then you'd only ever need to call make_connection once...
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-gabble/issues/206.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.