mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
restore user.running property
it was made a method for handing named_servers, but that made things way more complicated and replaced a boolean flag with a callable, which would behave unexpectedly but without error if a boolean flag was expected. Spawners have properties for dealing with this now, so use spawners Restore `user.running` as an alias for `user.spawner.ready`
This commit is contained in:
@@ -461,7 +461,7 @@ def test_slow_spawn(app, no_patience, slow_spawn):
|
||||
|
||||
@gen.coroutine
|
||||
def wait_spawn():
|
||||
while not app_user.running(''):
|
||||
while not app_user.running:
|
||||
yield gen.sleep(0.1)
|
||||
|
||||
yield wait_spawn()
|
||||
@@ -538,7 +538,7 @@ def test_slow_bad_spawn(app, no_patience, slow_bad_spawn):
|
||||
while user.spawner.pending:
|
||||
yield gen.sleep(0.1)
|
||||
# spawn failed
|
||||
assert not user.running('')
|
||||
assert not user.running
|
||||
assert app.users.count_active_users()['pending'] == 0
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ def test_spawn_limit(app, no_patience, slow_spawn, request):
|
||||
assert r.status_code == 429
|
||||
|
||||
# wait for ykka to finish
|
||||
while not users[0].running(''):
|
||||
while not users[0].running:
|
||||
yield gen.sleep(0.1)
|
||||
|
||||
# race? hjarka could finish in this time
|
||||
@@ -576,7 +576,7 @@ def test_spawn_limit(app, no_patience, slow_spawn, request):
|
||||
r.raise_for_status()
|
||||
assert app.users.count_active_users()['pending'] == 2
|
||||
users.append(user)
|
||||
while not all(u.running('') for u in users):
|
||||
while not all(u.running for u in users):
|
||||
yield gen.sleep(0.1)
|
||||
|
||||
# everybody's running, pending count should be back to 0
|
||||
|
Reference in New Issue
Block a user