-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(daemon): Improve cross-platform sockets using pid suffix #1620
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import '@endo/lockdown/commit-debug.js'; | |
import test from 'ava'; | ||
import url from 'url'; | ||
import path from 'path'; | ||
import os from 'os'; | ||
import { E } from '@endo/far'; | ||
import { makePromiseKit } from '@endo/promise-kit'; | ||
import { | ||
|
@@ -29,8 +30,8 @@ const locator = { | |
cachePath: path.join(dirname, 'tmp/cache'), | ||
sockPath: | ||
process.platform === 'win32' | ||
? raw`\\?\pipe\endo-test.sock` | ||
: path.join(dirname, 'tmp/endo.sock'), | ||
? raw`\\?\pipe\endo-test-${process.pid}.sock` | ||
: path.join(os.tmpdir(), `endo-test-${process.pid}.sock`), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using an OS tmpdir makes it harder to inspect the logs when the tests fail. If we go this route, there at least needs to be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this just the socket path, and nothing else? Or is there some bizarre derivation of the log path from the socket path I'm missing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see. You are correct. This only affects the location of the socket or named pipe, not the log dump. |
||
}; | ||
|
||
test.serial('lifecycle', async t => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m curious whether the problem can be better addressed by ensuring that Endo stomps over the existing named pipe, since restarting without a graceful shutdown will affect end users as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, if handling the named pipe gracefully on Windows is not in the cards, we may need to adjust some other behavior around
@endo/where
for discovering the rendezvous location of the Endo named pipe by looking first at the PID file to infer the PID in the named pipe.