Conversation
…ides_db_lock (#643 cluster H-2) The test relies on POSIX unlink-while-open semantics: ``--force`` wipes the state directory while the lock-holding sqlite3 connection lives in the same process. POSIX lets ``rmtree`` succeed because the directory entry is gone even though the inode is still open. Windows refuses with [WinError 32] The process cannot access the file because it is being used by another process Sibling tests in the same class (``test_refuses_when_writer_holds_lock``, ``test_proceeds_when_db_exists_but_no_writer``) pass on Windows and already cover the lock-detection path, so this is a method-level skip rather than a class-wide one. This is a test-only change — production behavior on Windows under ``--force`` against a live writer is a separate question that no current contract pins. Co-Authored-By: Claude <[email protected]>
This was referenced May 2, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Cluster H-2 of #643 —
test_force_overrides_db_lockrelies on POSIX unlink-while-open semantics that don't exist on Windows.The test holds a sqlite3 BEGIN IMMEDIATE write lock in the same process, then invokes
mm uninstall -y --forceand asserts the state directory was wiped. On POSIXrmtreesucceeds because the directory entry is gone even though the inode is still open via the live connection. On Windows the sameunlinkraises:Sibling tests in
TestDbWriterLockRefuses(test_refuses_when_writer_holds_lock,test_proceeds_when_db_exists_but_no_writer) already pass on Windows and cover the lock-detection path. This is a method-level skip rather than class-wide.Approach
sysalready imported in the module (test_uninstall_cmd.py:15).This is a test-only change — production behavior on Windows under
--forceagainst a live writer is a separate contract question, now tracked in #730 ("Windows: contract formm uninstall --forceagainst a live writer is undefined"). That issue documents the half-wipe failure mode ([WinError 32]mid-rmtree) and the three options for what--forceshould mean on Windows; this PR intentionally defers that decision and just unblocks CI.Test plan
uv run pytest packages/memtomem/tests/test_uninstall_cmd.py -v— 28/28 passed.uv run ruff check+uv run ruff format --checkon the touched file.test (windows-latest)will skiptest_force_overrides_db_lock(cluster H-2 of the Windows compat sweep).After this lands, the only remaining
windows-latestfailures from the sha-88c3e81 run are cluster A (test_context_status.py,test_dirty.py— wiki dirty classification) — separate root cause.🤖 Generated with Claude Code