Repository navigation
test, build: per-server test-server lock; v[0-9]* version tags - #776
Merged
Merged
Conversation
Concurrent pytest runs (e.g. from several worktrees) share the docker, embedded and external test servers, so they clobbered each other's calendars, and one run's teardown could stop a container another run still used. start() now takes an exclusive flock per server, held until the process exits; a second run on the same server waits, runs on different servers proceed in parallel. Random test order can make two runs deadlock, so the wait is capped (default 30 min), after which tests on that server fail at once. get_davclient()'s test-server fallback only probes the lock and moves on to the next server. A claim that fails halfway closes its lock file, so no leaked file keeps holding the lock. The setup hook is now installed for servers already running at collection too, so every test goes through start() and the lock; a docker server always gets a teardown, as a waiting run may restart it. Prompt: we now have multiple pytest runs (...), in different workbranches, but towards the same set of docker test calendar servers. This may clobber up. Followup-Prompt: Perhaps one lock file per test server. It can be very useful to run tests towards different servers in parallell, and that should be safe enough Followup-Prompt: go [implement the per-server lock: holder pid in the lock file, wait timeout, setup hook always calling start()] Followup-Prompt: please look into the code quality problems [flagged by GitHub code quality on #776: lock files left open when a claim fails] Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
hatch-vcs' default describe matches any tag with a number in it, so a non-release tag could become the nearest tag and break local builds with "Can't parse version from tag". Restrict describe to release tags. Prompt: For some of my python-libraries, [tags with numbers in them] can break local hatch-vcs builds, because hatch-vcs tries to read it as a version number. This has been fixed somewhere but not everywhere. Please check [and] fix it wherever it's relevant Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
Prompt: [fix issues found during the review process] Assisted-By: Claude Opus 5.5 <noreply@anthropic.com> Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
tobixen
force-pushed
the
test/server-session-lock
branch
from
October 14, 2026 20:11
365afbd to
8f5199f
Compare
get_davclient()'s test-server fallback called claim_server() on every server, but the caldav.testing and config-file servers that a pip-installed caldav uses have none, so every server was skipped. A server that failed to start also kept its claim until the process exited. Without fcntl (Windows), embedded and external servers now start unlocked instead of failing; docker servers still need fcntl. Prompt: dismiss the false positive and merge 776. Leave 768 for a while [the false positive: a CodeQL "file is not always closed" warning on a test fixture; 776 is #776 - its merge review found the bugs fixed here; 768 is #768, unrelated] Followup-Prompt: do the needful [fix the bug the merge review found - the fallback skipping every server of a pip-installed caldav - plus the claim left held after a failed start and the missing fcntl on Windows] Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
tobixen
added a commit
that referenced
this pull request
Oct 14, 2026
A thread waiting in claim_server() holds the module mutex, so claims on other servers wait too. Harmless for single-threaded pytest, so recorded rather than fixed. Prompt: /verify-quit do the needful [end-of-session audit; it listed this minor issue, found in the review of #776, as untracked] Followup-Prompt: file #2 [= record that issue in docs/design/TODO.md] Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Code and text AI-generated (Claude Opus 5.5); each commit message records the prompts.
Test and build housekeeping; the only library code touched is the test-server fallback in
caldav/config.py:start()now takes an exclusive flock per server, held until the process exits; runs against different servers proceed in parallel. The wait is capped (default 30 min,PYTHON_CALDAV_TEST_SERVER_LOCK_TIMEOUT), andget_davclient()'s test-server fallback only probes the lock and moves on to the next server.v[0-9]*tags. hatch-vcs' default describe matches any tag with a number in it, so a non-release tag could become the version and break local builds.Commits: