New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch socket.error exception in testprogram #48869

merged 1 commit into from Aug 2, 2018


None yet
3 participants

Ch3LL commented Aug 1, 2018

What does this PR do?

Fixes shell tests on mac. We need to make sure we are also catching socket.error when trying to bind to the port to determine if its already being used.

Here's an example of one of the shell test failures on mac:

ImportError: Failed to import test module:
Traceback (most recent call last):
  File "/opt/salt/lib/python2.7/unittest/", line 254, in _find_tests
    module = self._get_module_from_name(name)
  File "/opt/salt/lib/python2.7/unittest/", line 232, in _get_module_from_name
  File "/testing/tests/integration/shell/", line 29, in <module>
    from tests.integration.utils import testprogram
  File "/testing/tests/integration/utils/", line 584, in <module>
    class TestSaltProgram(six.with_metaclass(TestSaltProgramMeta, TestProgram)):
  File "/testing/tests/integration/utils/", line 600, in TestSaltProgram
    connect = sock.bind(('localhost', port))
  File "/opt/salt/lib/python2.7/", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 48] Address already in use

@Ch3LL Ch3LL requested a review from KaiSforza Aug 1, 2018

@rallytime rallytime merged commit a84f515 into saltstack:2017.7 Aug 2, 2018

5 of 8 checks passed

jenkins/pr/py2-centos-7 The py2-centos-7 job has failed
continuous-integration/jenkins/pr-merge This commit is being built
jenkins/pr/py3-centos-7 running py3-centos-7...
WIP ready for review
jenkins/pr/docs The docs job has passed
jenkins/pr/lint The lint job has passed
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment