pinokiod 8.2.11 → 8.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/anywhere/index.js +1 -1
- package/package.json +1 -1
- package/test/anywhere.test.js +12 -0
package/kernel/anywhere/index.js
CHANGED
|
@@ -686,7 +686,7 @@ class Anywhere {
|
|
|
686
686
|
if (!enabled) {
|
|
687
687
|
return Object.assign(base, { phase: 'off', running: false })
|
|
688
688
|
}
|
|
689
|
-
if (this.starting) {
|
|
689
|
+
if (this.starting || !this.api) {
|
|
690
690
|
return Object.assign(base, { phase: 'starting', running: false })
|
|
691
691
|
}
|
|
692
692
|
const owned = await this.assertOwnership()
|
package/package.json
CHANGED
package/test/anywhere.test.js
CHANGED
|
@@ -577,6 +577,18 @@ test('unverified daemons cannot receive logout, login, approval or Serve changes
|
|
|
577
577
|
}
|
|
578
578
|
})
|
|
579
579
|
|
|
580
|
+
test('status reports starting before autostart begins', async () => {
|
|
581
|
+
const anywhere = new Anywhere(fakeKernel(os.tmpdir()))
|
|
582
|
+
anywhere.config = { enabled: true }
|
|
583
|
+
anywhere.readPid = () => assert.fail('ownership must wait for autostart')
|
|
584
|
+
assert.equal(anywhere.starting, null)
|
|
585
|
+
const snapshot = await anywhere.snapshot()
|
|
586
|
+
assert.equal(snapshot.phase, 'starting')
|
|
587
|
+
assert.equal(snapshot.running, false)
|
|
588
|
+
assert.equal(snapshot.error, null)
|
|
589
|
+
assert.equal(anywhere.api, null, 'polling must not create a client before autostart')
|
|
590
|
+
})
|
|
591
|
+
|
|
580
592
|
test('status cannot control an unowned daemon while autostart is checking installation', async t => {
|
|
581
593
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-autostart-owner-'))
|
|
582
594
|
t.after(() => fs.rmSync(tmp, { recursive: true, force: true }))
|