You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: L0_lifecycle uses blind time.sleep(5) for model load/unload, causing flaky CI failures #8919
The qa/L0_lifecycle/lifecycle_test.py file contains 13 instances of time.sleep(5) that blindly wait for model load/unload operations before asserting is_model_ready(). Under CI resource contention, 5 seconds may not be sufficient for the model to reach the expected state, causing intermittent test failures.
Root cause
Fixed-duration sleeps are inherently unreliable for synchronizing with asynchronous model load/unload operations. The timing varies based on system load, I/O performance, and platform (especially Jetson/Orin). Other test files (e.g. log_format_test.py, pinned_memory_metrics_test.py) already use polling-based approaches with is_model_ready().
Proposed fix
Replace time.sleep(5) with a polling loop that uses triton_client.is_model_ready() to wait for the expected state, with a configurable timeout (default 30s). This approach:
Is resilient to CI load variations
Fails fast when the model reaches the expected state (typically <5s)
Provides clear error messages when the timeout is reached
Activity
kvnloo commentedon Sep 27, 2026
I can take this as a test-only cleanup.
I would add one bounded polling helper around
is_model_ready()and replace only the positive-state synchronization sleeps identified here.Proposed behavior:
time.monotonic();That avoids turning every
time.sleep(5)into a mechanical replacement where the sleep is actually the assertion window.I would keep the PR scoped to
L0_lifecycleand avoid changing server behavior.If that scope works, I can send it.