on xenial help sign in
Be more persistent for removing the socket.
commit2825a3c0465ad79e35c92fb0a2f5c9fb7bbf7fb7 authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 9 Oct 2013, 18:19 (13 years ago) parent5bd8f86
1 file changed+6−1
tests/autopilot/unity8/shell/tests/__init__.py+6−1
tests/autopilot/unity8/shell/tests/__init__.py+6−1
@@ -165,8 +165,13 @@ class UnityTestCase(AutopilotTestCase):
165165 self._setup_extra_mock_environment_patch()
166166
167167 # FIXME: we shouldn't be doing this
168+ # $MIR_SOCKET, fallback to $XDG_RUNTIME_DIR/mir_socket and /tmp/mir_socket as last resort
168169 try:
169− os.unlink(os.getenv('MIR_SOCKET', "/tmp/mir_socket"))
170+ os.unlink(os.getenv('MIR_SOCKET', os.path.join(os.getenv('XDG_RUNTIME_DIR'), "mir_socket")))
171+ except OSError:
172+ pass
173+ try:
174+ os.unlink("/tmp/mir_socket")
170175 except OSError:
171176 pass
172177