Print hub logs if hubtraf fails in integration tests

This commit is contained in:
yuvipanda
2018-09-14 10:48:35 -07:00
parent dffc3c0916
commit 9f538775e0

View File

@@ -132,6 +132,7 @@ async def test_long_username():
# FIXME: wait for reload to finish & hub to come up
# Should be part of tljh-config reload
await asyncio.sleep(1)
try:
async with User(username, hub_url, partial(login_dummy, password='')) as u:
await u.login()
await u.ensure_server()
@@ -141,3 +142,11 @@ async def test_long_username():
assert pwd.getpwnam(system_username) is not None
await u.stop_server()
except:
# If we have any errors, print jupyterhub logs before exiting
subprocess.check_call([
'journalctl',
'-u', 'jupyterhub',
'--no-pager'
])
raise