fix(ci): stabilize current main test regressions

This commit is contained in:
Stephen Schoettler 2026-04-30 06:36:50 -07:00
parent 9a14540603
commit 407dfbb021
3 changed files with 55 additions and 27 deletions

View file

@ -29,6 +29,12 @@ from tools.environments.base import _file_mtime_key
logger = logging.getLogger(__name__)
# Keep retry sleeps patchable without mutating the shared stdlib ``time``
# module. Patching ``tools.environments.file_sync.time.sleep`` replaces
# ``time.sleep`` globally because ``time`` is the module object; under xdist
# that lets unrelated background threads inflate retry-test call counts.
_sleep = time.sleep
_SYNC_INTERVAL_SECONDS = 5.0
_FORCE_SYNC_ENV = "HERMES_FORCE_FILE_SYNC"
@ -243,7 +249,7 @@ class FileSyncManager:
"sync_back: attempt %d failed (%s), retrying in %ds",
attempt + 1, exc, delay,
)
time.sleep(delay)
_sleep(delay)
logger.warning("sync_back: all %d attempts failed: %s", _SYNC_BACK_MAX_RETRIES, last_exc)