Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ def test_get_credentials_keyring_timeout_falls_back_to_remote_flow(mock_deps, mo
res = get_credentials("dummy_config.json", provider=AuthProvider.OAUTH2)
finally:
hang_event.set()
for t in list(threading.enumerate()):
if t is not threading.current_thread() and t.daemon:
t.join(timeout=1.0)

mock_flow.fetch_token.assert_called_once_with(code="pasted-code")
mock_deps["session"].assert_called_once_with(mock_creds_new)
Expand Down Expand Up @@ -455,6 +458,9 @@ def custom_slow_operation():
_run_with_timeout(custom_slow_operation, timeout=0.01)
finally:
hang_event.set()
for t in list(threading.enumerate()):
if t is not threading.current_thread() and t.daemon:
t.join(timeout=1.0)


def test_remote_redirect_is_not_oob():
Expand Down Expand Up @@ -651,6 +657,9 @@ def test_linux_keyring_lock_check_runs_under_timeout(mock_deps, mocker, capsys):
res = get_credentials("dummy_config.json", provider=AuthProvider.OAUTH2)
finally:
hang_event.set()
for t in list(threading.enumerate()):
if t is not threading.current_thread() and t.daemon:
t.join(timeout=1.0)

err = capsys.readouterr().err
assert "Operation 'get_password' timed out" in err
Expand Down