Skip to content

test_web_profile fails on OS X 10.12 without network #9700

@dhomeier

Description

@dhomeier

Description

This test fails reliably on my OS X machine when not connected to the internets, with a failure of
`create_connection(('127.0.0.1', 0)):

Expected behavior

I did not expect network-related failures with remote_data=False set, so first thought this should have been marked remote_data() in some way, but since it is in fact trying to connect to a local address, maybe this is rather a quirk of OS X's lookup procedure.

Actual behavior

_______________________________________________________________________ ERROR at setup of TestWebProfile.test_main _______________________________________________________________________

>       lambda: ihook(item=item, **kwds),
        when=when,
    )

/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py:306: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
lib/python3.8/site-packages/astropy/samp/tests/test_web_profile.py:51: in setup_method
    self.client2.connect(web_port=self.hub._web_port, pool_size=2)
lib/python3.8/site-packages/astropy/samp/tests/web_profile_test_helpers.py:263: in connect
    self.hub.connect(pool_size, web_port=web_port)
lib/python3.8/site-packages/astropy/samp/tests/web_profile_test_helpers.py:57: in connect
    self.ping()
lib/python3.8/site-packages/astropy/samp/hub_proxy.py:111: in ping
    return self._samp_hub.ping()
lib/python3.8/site-packages/astropy/samp/utils.py:62: in __call__
    response = function(*args, **kwrds)
/sw/lib/python3.8/xmlrpc/client.py:1109: in __call__
    return self.__send(self.__name, args)
/sw/lib/python3.8/xmlrpc/client.py:1450: in __request
    response = self.__transport.request(
/sw/lib/python3.8/xmlrpc/client.py:1153: in request
    return self.single_request(host, handler, request_body, verbose)
/sw/lib/python3.8/xmlrpc/client.py:1165: in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
/sw/lib/python3.8/xmlrpc/client.py:1278: in send_request
    self.send_content(connection, request_body)
/sw/lib/python3.8/xmlrpc/client.py:1308: in send_content
    connection.endheaders(request_body)
/sw/lib/python3.8/http/client.py:1225: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/sw/lib/python3.8/http/client.py:1004: in _send_output
    self.send(msg)
/sw/lib/python3.8/http/client.py:944: in send
    self.connect()
/sw/lib/python3.8/http/client.py:915: in connect
    self.sock = self._create_connection(
/sw/lib/python3.8/socket.py:807: in create_connection
    raise err
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

address = ('127.0.0.1', 0), timeout = <object object at 0x10e2c99d0>, source_address = None

    def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
                          source_address=None):
        """Connect to *address* and return the socket object.
    
        Convenience function.  Connect to *address* (a 2-tuple ``(host,
        port)``) and return the socket object.  Passing the optional
        *timeout* parameter will set the timeout on the socket instance
        before attempting to connect.  If no *timeout* is supplied, the
        global default timeout setting returned by :func:`getdefaulttimeout`
        is used.  If *source_address* is set it must be a tuple of (host, port)
        for the socket to bind as a source address before making the connection.
        A host of '' or port 0 tells the OS to use the default.
        """
    
        host, port = address
        err = None
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
            af, socktype, proto, canonname, sa = res
            sock = None
            try:
                sock = socket(af, socktype, proto)
                if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                    sock.settimeout(timeout)
                if source_address:
                    sock.bind(source_address)
>               sock.connect(sa)
E               OSError: [Errno 49] Can't assign requested address

/sw/lib/python3.8/socket.py:796: OSError
--------------------------------------------------------------------------------- Captured stdout setup ----------------------------------------------------------------------------------
INFO: Hub started [astropy.samp.hub]
--------------------------------------------------------------------------------- Captured stderr setup ----------------------------------------------------------------------------------
WARNING: Port 0 already in use. Impossible to run the Hub with Web Profile support. [astropy.samp.hub]
--- Logging error ---
Traceback (most recent call last):
  File "/sw/lib/python3.8/site-packages/astropy/samp/hub.py", line 262, in _start_web_profile_server
    self._web_profile_server = WebProfileXMLRPCServer(
  File "/sw/lib/python3.8/site-packages/astropy/samp/web_profile.py", line 139, in __init__
    ThreadingXMLRPCServer.__init__(self, addr, log, requestHandler,
  File "/sw/lib/python3.8/site-packages/astropy/samp/standard_profile.py", line 139, in __init__
    SimpleXMLRPCServer.__init__(self, addr, requestHandler,
  File "/sw/lib/python3.8/xmlrpc/server.py", line 605, in __init__
    socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
  File "/sw/lib/python3.8/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/sw/lib/python3.8/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/sw/lib/python3.8/logging/__init__.py", line 1081, in emit
    msg = self.format(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 925, in format
    return fmt.format(record)
  File "/sw/lib/python3.8/site-packages/_pytest/logging.py", line 70, in format
    return super().format(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 664, in format
    record.message = record.getMessage()
  File "/sw/lib/python3.8/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "<stdin>", line 1, in <module>
  File "/sw/lib/python3.8/site-packages/astropy/tests/runner.py", line 266, in test
    return runner.run_tests(**kwargs)
  File "/sw/lib/python3.8/site-packages/astropy/tests/runner.py", line 611, in run_tests
    return super().run_tests(**kwargs)
  File "/sw/lib/python3.8/site-packages/astropy/tests/runner.py", line 248, in run_tests
    return pytest.main(args=args, plugins=plugins)
  File "/sw/lib/python3.8/site-packages/_pytest/config/__init__.py", line 91, in main
    ret = config.hook.pytest_cmdline_main(
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 233, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 196, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 240, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 264, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 92, in pytest_runtest_protocol
    self.runner.pytest_runtest_protocol(item, nextitem)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 81, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 90, in runtestprotocol
    rep = call_and_report(item, "setup", log)
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 129, in call_and_report
    call = self.call_runtest_hook(item, when, **kwds)
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 305, in call_runtest_hook
    call_info = getattr(CallInfo, "from_call", CallInfo)(
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 229, in from_call
    result = func()
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 306, in <lambda>
    lambda: ihook(item=item, **kwds),
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 119, in pytest_runtest_setup
    item.session._setupstate.prepare(item)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 359, in prepare
    col.setup()
  File "/sw/lib/python3.8/site-packages/_pytest/python.py", line 1449, in setup
    fixtures.fillfixtures(self)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 293, in fillfixtures
    request._fillfixtures()
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 472, in _fillfixtures
    item.funcargs[argname] = self.getfixturevalue(argname)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 482, in getfixturevalue
    return self._get_active_fixturedef(argname).cached_result[0]
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 498, in _get_active_fixturedef
    self._compute_fixture_value(fixturedef)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 579, in _compute_fixture_value
    fixturedef.execute(request=subrequest)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 908, in execute
    return hook.pytest_fixture_setup(fixturedef=self, request=request)
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 957, in pytest_fixture_setup
    result = call_fixture_func(fixturefunc, request, kwargs)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 783, in call_fixture_func
    res = next(it)
  File "/sw/lib/python3.8/site-packages/_pytest/python.py", line 756, in xunit_setup_method_fixture
    _call_with_optional_argument(func, method)
  File "/sw/lib/python3.8/site-packages/_pytest/python.py", line 669, in _call_with_optional_argument
    func(arg)
  File "/sw/lib/python3.8/site-packages/astropy/samp/tests/test_web_profile.py", line 43, in setup_method
    self.hub.start()
  File "/sw/lib/python3.8/site-packages/astropy/samp/hub.py", line 389, in start
    self._start_web_profile_server()
  File "/sw/lib/python3.8/site-packages/astropy/samp/hub.py", line 270, in _start_web_profile_server
    log.warning("Port {} already in use. Impossible to run the "
  File "/sw/lib/python3.8/logging/__init__.py", line 1446, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/sw/lib/python3.8/logging/__init__.py", line 1577, in _log
    self.handle(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 1587, in handle
    self.callHandlers(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 1649, in callHandlers
    hdlr.handle(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 950, in handle
    self.emit(record)
  File "/sw/lib/python3.8/site-packages/_pytest/logging.py", line 301, in emit
    logging.StreamHandler.emit(self, record)
Message: 'Port 0 already in use. Impossible to run the Hub with Web Profile support.'
Arguments: (<class 'astropy.samp.errors.SAMPWarning'>,)
----------------------------------------------------------------------------------- Captured log setup -----------------------------------------------------------------------------------
INFO     astropy:hub.py:402 Hub started
___________________________________________________________________ ERROR at setup of TestWebProfile.test_web_profile ____________________________________________________________________

self = <astropy.samp.tests.test_web_profile.TestWebProfile object at 0x128cc2cd0>
method = <bound method TestWebProfile.test_web_profile of <astropy.samp.tests.test_web_profile.TestWebProfile object at 0x128cc2cd0>>

    def setup_method(self, method):
    
        self.dialog = AlwaysApproveWebProfileDialog()
        t = threading.Thread(target=self.dialog.poll)
        t.start()
    
        self.tmpdir = tempfile.mkdtemp()
        lockfile = os.path.join(self.tmpdir, '.samp')
    
        self.hub = SAMPHubServer(web_profile_dialog=self.dialog,
                                 lockfile=lockfile,
                                 web_port=0, pool_size=1)
        self.hub.start()
    
        self.client1 = SAMPIntegratedClient()
        self.client1.connect(hub=self.hub, pool_size=1)
        self.client1_id = self.client1.get_public_id()
        self.client1_key = self.client1.get_private_key()
    
        self.client2 = SAMPIntegratedWebClient()
>       self.client2.connect(web_port=self.hub._web_port, pool_size=2)

lib/python3.8/site-packages/astropy/samp/tests/test_web_profile.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
lib/python3.8/site-packages/astropy/samp/tests/web_profile_test_helpers.py:263: in connect
    self.hub.connect(pool_size, web_port=web_port)
lib/python3.8/site-packages/astropy/samp/tests/web_profile_test_helpers.py:57: in connect
    self.ping()
lib/python3.8/site-packages/astropy/samp/hub_proxy.py:111: in ping
    return self._samp_hub.ping()
lib/python3.8/site-packages/astropy/samp/utils.py:62: in __call__
    response = function(*args, **kwrds)
/sw/lib/python3.8/xmlrpc/client.py:1109: in __call__
    return self.__send(self.__name, args)
/sw/lib/python3.8/xmlrpc/client.py:1450: in __request
    response = self.__transport.request(
/sw/lib/python3.8/xmlrpc/client.py:1153: in request
    return self.single_request(host, handler, request_body, verbose)
/sw/lib/python3.8/xmlrpc/client.py:1165: in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
/sw/lib/python3.8/xmlrpc/client.py:1278: in send_request
    self.send_content(connection, request_body)
/sw/lib/python3.8/xmlrpc/client.py:1308: in send_content
    connection.endheaders(request_body)
/sw/lib/python3.8/http/client.py:1225: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/sw/lib/python3.8/http/client.py:1004: in _send_output
    self.send(msg)
/sw/lib/python3.8/http/client.py:944: in send
    self.connect()
/sw/lib/python3.8/http/client.py:915: in connect
    self.sock = self._create_connection(
/sw/lib/python3.8/socket.py:807: in create_connection
    raise err
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

address = ('127.0.0.1', 0), timeout = <object object at 0x10e2c99d0>, source_address = None

    def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
                          source_address=None):
        """Connect to *address* and return the socket object.
    
        Convenience function.  Connect to *address* (a 2-tuple ``(host,
        port)``) and return the socket object.  Passing the optional
        *timeout* parameter will set the timeout on the socket instance
        before attempting to connect.  If no *timeout* is supplied, the
        global default timeout setting returned by :func:`getdefaulttimeout`
        is used.  If *source_address* is set it must be a tuple of (host, port)
        for the socket to bind as a source address before making the connection.
        A host of '' or port 0 tells the OS to use the default.
        """
    
        host, port = address
        err = None
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
            af, socktype, proto, canonname, sa = res
            sock = None
            try:
                sock = socket(af, socktype, proto)
                if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                    sock.settimeout(timeout)
                if source_address:
                    sock.bind(source_address)
>               sock.connect(sa)
E               OSError: [Errno 49] Can't assign requested address

/sw/lib/python3.8/socket.py:796: OSError
--------------------------------------------------------------------------------- Captured stdout setup ----------------------------------------------------------------------------------
INFO: Hub started [astropy.samp.hub]
--------------------------------------------------------------------------------- Captured stderr setup ----------------------------------------------------------------------------------
WARNING: Port 0 already in use. Impossible to run the Hub with Web Profile support. [astropy.samp.hub]
--- Logging error ---
Traceback (most recent call last):
  File "/sw/lib/python3.8/site-packages/astropy/samp/hub.py", line 262, in _start_web_profile_server
    self._web_profile_server = WebProfileXMLRPCServer(
  File "/sw/lib/python3.8/site-packages/astropy/samp/web_profile.py", line 139, in __init__
    ThreadingXMLRPCServer.__init__(self, addr, log, requestHandler,
  File "/sw/lib/python3.8/site-packages/astropy/samp/standard_profile.py", line 139, in __init__
    SimpleXMLRPCServer.__init__(self, addr, requestHandler,
  File "/sw/lib/python3.8/xmlrpc/server.py", line 605, in __init__
    socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
  File "/sw/lib/python3.8/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/sw/lib/python3.8/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/sw/lib/python3.8/logging/__init__.py", line 1081, in emit
    msg = self.format(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 925, in format
    return fmt.format(record)
  File "/sw/lib/python3.8/site-packages/_pytest/logging.py", line 70, in format
    return super().format(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 664, in format
    record.message = record.getMessage()
  File "/sw/lib/python3.8/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "<stdin>", line 1, in <module>
  File "/sw/lib/python3.8/site-packages/astropy/tests/runner.py", line 266, in test
    return runner.run_tests(**kwargs)
  File "/sw/lib/python3.8/site-packages/astropy/tests/runner.py", line 611, in run_tests
    return super().run_tests(**kwargs)
  File "/sw/lib/python3.8/site-packages/astropy/tests/runner.py", line 248, in run_tests
    return pytest.main(args=args, plugins=plugins)
  File "/sw/lib/python3.8/site-packages/_pytest/config/__init__.py", line 91, in main
    ret = config.hook.pytest_cmdline_main(
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 233, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 196, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 240, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/main.py", line 264, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 92, in pytest_runtest_protocol
    self.runner.pytest_runtest_protocol(item, nextitem)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 81, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 90, in runtestprotocol
    rep = call_and_report(item, "setup", log)
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 129, in call_and_report
    call = self.call_runtest_hook(item, when, **kwds)
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 305, in call_runtest_hook
    call_info = getattr(CallInfo, "from_call", CallInfo)(
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 229, in from_call
    result = func()
  File "/sw/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 306, in <lambda>
    lambda: ihook(item=item, **kwds),
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 119, in pytest_runtest_setup
    item.session._setupstate.prepare(item)
  File "/sw/lib/python3.8/site-packages/_pytest/runner.py", line 359, in prepare
    col.setup()
  File "/sw/lib/python3.8/site-packages/_pytest/python.py", line 1449, in setup
    fixtures.fillfixtures(self)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 293, in fillfixtures
    request._fillfixtures()
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 472, in _fillfixtures
    item.funcargs[argname] = self.getfixturevalue(argname)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 482, in getfixturevalue
    return self._get_active_fixturedef(argname).cached_result[0]
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 498, in _get_active_fixturedef
    self._compute_fixture_value(fixturedef)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 579, in _compute_fixture_value
    fixturedef.execute(request=subrequest)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 908, in execute
    return hook.pytest_fixture_setup(fixturedef=self, request=request)
  File "/sw/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 92, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/sw/lib/python3.8/site-packages/pluggy/manager.py", line 83, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/sw/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 957, in pytest_fixture_setup
    result = call_fixture_func(fixturefunc, request, kwargs)
  File "/sw/lib/python3.8/site-packages/_pytest/fixtures.py", line 783, in call_fixture_func
    res = next(it)
  File "/sw/lib/python3.8/site-packages/_pytest/python.py", line 756, in xunit_setup_method_fixture
    _call_with_optional_argument(func, method)
  File "/sw/lib/python3.8/site-packages/_pytest/python.py", line 669, in _call_with_optional_argument
    func(arg)
  File "/sw/lib/python3.8/site-packages/astropy/samp/tests/test_web_profile.py", line 43, in setup_method
    self.hub.start()
  File "/sw/lib/python3.8/site-packages/astropy/samp/hub.py", line 389, in start
    self._start_web_profile_server()
  File "/sw/lib/python3.8/site-packages/astropy/samp/hub.py", line 270, in _start_web_profile_server
    log.warning("Port {} already in use. Impossible to run the "
  File "/sw/lib/python3.8/logging/__init__.py", line 1446, in warning
    self._log(WARNING, msg, args, **kwargs)
  File "/sw/lib/python3.8/logging/__init__.py", line 1577, in _log
    self.handle(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 1587, in handle
    self.callHandlers(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 1649, in callHandlers
    hdlr.handle(record)
  File "/sw/lib/python3.8/logging/__init__.py", line 950, in handle
    self.emit(record)
  File "/sw/lib/python3.8/site-packages/_pytest/logging.py", line 301, in emit
    logging.StreamHandler.emit(self, record)
Message: 'Port 0 already in use. Impossible to run the Hub with Web Profile support.'
Arguments: (<class 'astropy.samp.errors.SAMPWarning'>,)
----------------------------------------------------------------------------------- Captured log setup -----------------------------------------------------------------------------------
INFO     astropy:hub.py:402 Hub started

Steps to Reproduce

python3.8 -c 'import astropy; astropy.test(package="samp", args="-vk web_profile", remote_data=False)'

System Details

Same on 3.6.9 and 3.7.5:

platform darwin -- Python 3.8.0, pytest-5.3.0, py-1.8.0, pluggy-0.13.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/Users/derek/.hypothesis/examples')

Running tests with Astropy version 4.1.dev27005.
Running tests in astropy/samp.

Date: 2019-11-27T12:51:49

Platform: macOS-10.12.6-x86_64-i386-64bit

Executable: /sw/bin/python3.8

Full Python Version:
3.8.0 (default, Oct 23 2019, 19:06:20) 
[Clang 9.0.0 (clang-900.0.39.2)]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Package versions: 
Numpy: 1.17.4
Scipy: 1.3.2
Matplotlib: 3.1.0
h5py: 2.9.0
Pandas: 0.25.3
Cython: 0.29.13
Scikit-image: not available
asdf: 2.4.2
astropy-helpers: 3.1

Using Astropy options: remote_data: none.
Matplotlib: 3.1.0
Freetype: 2.6.1
rootdir: /sw/lib/python3.8/site-packages
plugins: asdf-2.4.2, flaky-3.5.3, hypothesis-4.24.3, arraydiff-0.3, astropy-header-0.1.1, cov-2.6.0, doctestplus-0.5.0, expect-1.1.0, forked-1.1.3, mock-1.10.4, mpl-0.11, openfiles-0.3.2, remotedata-0.3.1, xdist-1.30.0
collected 19 items / 17 deselected / 2 selected                                                                                                                            

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions