test: fix stale-socket e2e tests to exercise scan-based discovery - #27
Merged
Merged
Conversation
4 tasks
Owner
|
Thanks for the thorough analysis and fix! LGTM, Merging! |
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.
Fixes #26.
Two structural bugs in the e2e stale-socket tests prevented them from exercising what they claimed. See issue #26 for details.
Changes (tests only, no
bin/orlua/changes):test_stale_socket_recoverynow genuinely exercises scan-based socket discovery. Starts nvim on--listen "/tmp/nvim.$$/0"(a pathbin/nvim-socket.shrecognizes via its/tmp/nvim.*/0glob), crashes it withkill -9leaving a stale socket, starts a second nvim, verifies the hook rediscovers via the scan.scanmode torun_pretool_hook/run_posttool_hookthat explicitly clearsNVIM_LISTEN_ADDRESS=to force the slow path.test_no_nvim_gracefultotest_no_matching_project_nvim_gracefuland rewrites it to assert only what the body proves (clean exit + proposed file generation). Genuine isolation from ambient nvim instances would require invasive environment changes, so the test is scoped to honest claims.assert_file_existschanged from[[ ! -f ]]to[[ ! -e ]]because unix domain sockets fail-f.setup_test_projectnow canonicalizesTEST_PROJECT_DIRwithpwd -Pto handle macOS's/tmp→/private/tmpsymlink, which otherwise breaks the CWD-preference matching infind_nvim_socket.Verified locally: 14/14 tests pass on macOS (nvim 0.11).
CI portability:
/tmp/nvim.<pid>/0is in the production scanner's glob set and works cross-platform. Thepwd -Pfix is macOS-specific and a no-op on Linux.