Skip to content
Merged
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
8 changes: 7 additions & 1 deletion tests/test_plugin_xmpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ def run_on_loop(loop: asyncio.AbstractEventLoop, coro: Any) -> Any:
except Exception:
SLIXMPP_AVAILABLE = False

# Seconds to sleep before forcing the timeout branch in _FakeDoneEvent.wait().
# This gives the worker thread enough time to progress to a known checkpoint
# (e.g. event loop created, client instantiated) without relying on a longer
# wall-clock timeout that would slow tests down.
WORKER_THREAD_STARTUP_DELAY: float = 0.02


# ---------------------------------------------------------------------------
# Fake Slixmpp Client
Expand Down Expand Up @@ -215,7 +221,7 @@ class _FakeDoneEvent:
signal_evt: Optional[threading.Event] = None

# Small delay to allow the runner thread to reach any blocking point.
pre_wait: float = 0.02
pre_wait: float = WORKER_THREAD_STARTUP_DELAY

def __init__(self) -> None:
self._set = False
Expand Down