Skip to content

Wait for the Emacs test daemon to exit before cleanup - #99

Merged
luciusmagn merged 1 commit into
lambda-symbolics:masterfrom
conornash:await-emacs-test-daemon-exit
Oct 12, 2026
Merged

luciusmagn merged 1 commit into
lambda-symbolics:masterfrom
conornash:await-emacs-test-daemon-exit

Conversation

@conornash

Copy link
Copy Markdown
Contributor

A small follow-up to #98. With that change in place, the real Emacs daemon test failed once on my machine while cleaning up its temporary directory. I've only seen it happen that one time, so the evidence is thin; the explanation below is the best I could work out, and I'm very happy to be told otherwise.

The below is the agent explanation of what this PR does:

test-emacs-tools-real-daemon failed in cleanup on macOS with DELETE-FILE-ERROR: could not delete .#outside.txt, "No such file or directory".

The test leaves an unsaved edit in the buffer visiting outside.txt, so Emacs holds a .#outside.txt lock link in the runtime directory. Cleanup sent (kill-emacs) and immediately deleted that directory, but kill-emacs returns before the daemon exits, and the daemon unlinks its lock files on the way out. The tree deletion listed the lock, the daemon removed it, and the deletion then failed on the vanished entry.

The test now records the daemon's (emacs-pid) after startup and, after (kill-emacs), waits up to 10 seconds with platform-process-alive-p for that process to exit before deleting the runtime directory.

Evidence: with an unsaved edit, the lock exists right after (kill-emacs) returns while the daemon is still alive, and is gone once the process exits. The emacs suite passes (5 cases, 70 checks) and the real-daemon test passed 10/10 consecutive runs; the race did not reproduce locally without the change, so the failing run that prompted this is the only observed occurrence.

@luciusmagn
luciusmagn force-pushed the await-emacs-test-daemon-exit branch from 9ee0b39 to 4154af6 Compare October 12, 2026 16:13
@luciusmagn
luciusmagn merged commit c7fcd24 into lambda-symbolics:master Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants