Repository navigation
tests(fix[sync]): Default VCSPULL_SYNC_TIMEOUT_SECONDS=30 in pytest - #618
Merged
Merged
Conversation
why: On heavily contended hosts (load average 50-80), libvcs's 10-16 sequential hg Python spawns per HgSync.update_repo() call exceed both the 10s CLI default in test_sync_errored_hg_repo and the 15s literal in test_hg_configured_remote_reaches_native_sync. what: - Default VCSPULL_SYNC_TIMEOUT_SECONDS=30 alongside VCSPULL_JOBS=1 in tests/conftest.py when unset in the caller environment - Route test_hg_configured_remote_reaches_native_sync through _resolve_repo_timeout(None) instead of a hardcoded literal - Seed upstream in test_hg_configured_remote_reaches_native_sync with shutil.copytree and hg commit -A to drop redundant setup hg spawns
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #618 +/- ##
=======================================
Coverage 85.25% 85.25%
=======================================
Files 38 38
Lines 7663 7663
Branches 1567 1567
=======================================
Hits 6533 6533
Misses 751 751
Partials 379 379 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #616
Summary
VCSPULL_SYNC_TIMEOUT_SECONDS=30intests/conftest.pyalongsideVCSPULL_JOBS=1when unset in the caller environment.test_hg_configured_remote_reaches_native_syncthrough_resolve_repo_timeout(None)instead of a hardcoded literal timeout.upstreamintest_hg_configured_remote_reaches_native_syncwithshutil.copytreeandhg commit -Ato drop redundant setuphgspawns.1. Owner and boundary
tests/conftest.pyand Mercurial remote worker test setup intests/test_sync.py.sync/async, CLI/API, single/batch, orN/A): Checked_resolve_repo_timeoutprecedence tests intests/cli/test_sync_watchdog.py, CLIvcspull syncMercurial error tests intests/test_cli.py, and directrun_sync_processworker tests intests/test_sync.py._DEFAULT_REPO_TIMEOUT_SECONDS = 10unchanged while giving pytest CLI and worker Mercurial tests (which spawn 10–16 sequentialhgPython interpreters perHgSync.update_repo()call) sufficient scheduler headroom on heavily contended workstations (load average 50–80).2. Failure before the fix (
N/Afor docs, lockfile bumps, or pure refactors)<base>commit, or<pre_fix_head>SHA if fixing a defect introduced in this PR):d83187eload average: 65–79), full-suiteuv run py.testtimed out ontests/test_cli.py::test_sync_errored_hg_repo[hg-deleted-remote-shows-failed](11.1svs10sCLI default across 10hgcalls) andtests/test_sync.py::test_hg_configured_remote_reaches_native_sync[True](16.09svs15sacross 16hgcalls).3. Verification and tool disclosure
N/A):uv run ruff format .,uv run ruff check . --fix --show-fixes,uv run ty check --error-on-warning .(Python 3.11 and 3.15), anduv run py.test tests/cli/test_sync_watchdog.py tests/cli/test_sync_sigint.py tests/test_cli.py tests/test_sync.py(N/Afor production revert check; test-only change)..github/workarounds.tomlupdates (Noneif none):None/usr/bin/hgand host runqueue contention (uptime/cProfile), updatedtests/conftest.pyandtests/test_sync.py, and verified lint,ty, and pytest gates.Test plan
_resolve_repo_timeoutunit and doctest checks continue to verify CLI flag,VCSPULL_SYNC_TIMEOUT_SECONDS, and10sdefault precedencetest_sync_errored_hg_repoandtest_hg_configured_remote_reaches_native_syncpass under heavy host load without hardcoded test literals