test_nagios failure during conda build on osx
I'm seeing a failure in the test suite as part of a conda build:
============================= test session starts ==============================
platform darwin -- Python 3.7.1, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
rootdir: $SRC_DIR, inifile:
plugins: socket-0.3.2, remotedata-0.3.1, openfiles-0.3.1, doctestplus-0.1.3, arraydiff-0.3, celery-4.2.1
collected 119 items
tests/test_condor.py ........ [ 6%]
tests/test_nagios.py .F [ 8%]
tests/test_sentry.py . [ 9%]
tests/test_tasks_bayestar.py ... [ 11%]
tests/test_tasks_circulars.py . [ 12%]
tests/test_tasks_condor.py ... [ 15%]
tests/test_tasks_detchar.py ....... [ 21%]
tests/test_tasks_external_triggers.py ....... [ 26%]
tests/test_tasks_first2years.py .. [ 28%]
tests/test_tasks_gcn.py .... [ 31%]
tests/test_tasks_gcn_validate.py .. [ 33%]
tests/test_tasks_gracedb.py ............... [ 46%]
tests/test_tasks_ligo_fermi_skymaps.py ..... [ 50%]
tests/test_tasks_lvalert.py .... [ 53%]
tests/test_tasks_orchestrator.py ........... [ 63%]
tests/test_tasks_p_astro_gstlal.py ..... [ 67%]
tests/test_tasks_p_astro_other.py ... [ 69%]
tests/test_tasks_raven.py .............. [ 81%]
tests/test_tasks_skymaps.py ..... [ 85%]
tests/test_tasks_superevents.py ............... [ 98%]
tests/test_tempfile.py .. [100%]
=================================== FAILURES ===================================
_________________________________ test_nagios __________________________________
capsys = <_pytest.capture.CaptureFixture object at 0x124f49a90>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x124e7db38>
socket_enabled = None
starter = <class 'gwcelery.tests.process.starter.<locals>.Starter'>
tmpdir = local('/private/var/folders/xh/jdrqg2bx3s5f4lkq0rf2903c0000gq/T/pytest-of-duncan/pytest-0/test_nagios0')
def test_nagios(capsys, monkeypatch, socket_enabled, starter, tmpdir):
# no broker
unix_socket = str(tmpdir / 'sock')
monkeypatch.setenv('CELERY_BROKER_URL', 'redis+socket://' + unix_socket)
with pytest.raises(SystemExit) as excinfo:
app.start(['gwcelery', 'nagios'])
assert excinfo.value.code == nagios.NagiosPluginStatus.CRITICAL
out, err = capsys.readouterr()
assert 'CRITICAL: No connection to broker' in out
# broker, no worker
redis_server = find_executable('redis-server')
if redis_server is None:
pytest.skip('redis-server is not installed')
starter.exec_process(
[redis_server, '--port', '0', '--unixsocket', unix_socket,
'--unixsocketperm', '700'], timeout=10,
magic_words=b'The server is now ready to accept connections')
with pytest.raises(SystemExit) as excinfo:
app.start(['gwcelery', 'nagios'])
assert excinfo.value.code == nagios.NagiosPluginStatus.CRITICAL
out, err = capsys.readouterr()
assert 'CRITICAL: Not all expected queues are active' in out
# worker, no tasks
starter.python_process(
args=(['gwcelery', 'worker', '-l', 'info',
'-Q', 'celery,exttrig,openmp,superevent'],),
target=app.start, timeout=10, magic_words=b'ready.')
with pytest.raises(SystemExit) as excinfo:
app.start(['gwcelery', 'nagios'])
assert excinfo.value.code == nagios.NagiosPluginStatus.CRITICAL
out, err = capsys.readouterr()
> assert 'CRITICAL: Not all expected tasks are active' in out
E AssertionError: assert 'CRITICAL: Not all expected tasks are active' in 'CRITICAL: Not all expected queues are active\nAssertionError: Missing queues: openmp, superevent, exttrig, celery\n\n'
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/lib/python3.7/site-packages/gwcelery/tests/test_nagios.py:60: AssertionError
--------------------------- Captured stderr teardown ---------------------------
Exception ignored in: <function _ConnectionBase.__del__ at 0x125155730>
Traceback (most recent call last):
File "$PREFIX/lib/python3.7/multiprocessing/connection.py", line 132, in __del__
self._close()
File "$PREFIX/lib/python3.7/multiprocessing/connection.py", line 361, in _close
_close(self._handle)
OSError: [Errno 9] Bad file descriptor
Exception ignored in: <function _ConnectionBase.__del__ at 0x125155730>
Traceback (most recent call last):
File "$PREFIX/lib/python3.7/multiprocessing/connection.py", line 132, in __del__
self._close()
File "$PREFIX/lib/python3.7/multiprocessing/connection.py", line 361, in _close
_close(self._handle)
OSError: [Errno 9] Bad file descriptor
I have no idea whether this indicates a bug in the code, or just a missing dependency, or a missing environmental component during testing. Any advice is appreciated.