fix: clean stale pid on stop (#1015)
This commit is contained in:
@@ -125,6 +125,22 @@ describe('CLI port detection', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('cleans a stale server PID file during stop', async () => {
|
||||
const home = mkdtempSync(join(tmpdir(), 'hermes-web-ui-cli-stale-pid-'))
|
||||
process.env.HERMES_WEB_UI_HOME = home
|
||||
const pidFile = join(home, 'server.pid')
|
||||
writeFileSync(pidFile, '999999999\n')
|
||||
|
||||
try {
|
||||
const { stopDaemon } = await loadCli()
|
||||
stopDaemon()
|
||||
|
||||
expect(existsSync(pidFile)).toBe(false)
|
||||
} finally {
|
||||
rmSync(home, { recursive: true, force: true })
|
||||
}
|
||||
})
|
||||
|
||||
it('resets an existing admin user to the default password', async () => {
|
||||
const home = mkdtempSync(join(tmpdir(), 'hermes-web-ui-cli-default-login-'))
|
||||
process.env.HERMES_WEB_UI_HOME = home
|
||||
|
||||
Reference in New Issue
Block a user