fixup! feat(status): a status page, for the phone of whoever looks after the box
check / check (push) Canceled after 0s

booting: a ready counts unless it's from before the latest outage
the server saw. The box's services restart together, so the button's
ready can come before the next check sees the IR port up; comparing
ready with when the port came up read that as booting, until the next
ready. A server restarted while the box stayed up did the same.

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-02 18:23:54 -06:00
1 parent c335935e2d
commit f35da9b883
2 files changed
+25 -3

No files matched your search

+18
View File
@@ -41,6 +41,24 @@ test('a ready from before the box went away does not count: booting', () => {
assert.equal(s.summary(4 * MIN).state.word, 'booting');
});
test('a ready during the outage counts: services restart together, and the check sees the box up last', () => {
const s = new Status(dayOf);
s.check('box', true, 0);
s.record({ at: 1 * MIN, kind: 'ready', source: 'pdtv26-button' });
s.check('box', false, 2 * MIN);
s.record({ at: 2.5 * MIN, kind: 'ready', source: 'pdtv26-button' });
s.check('box', true, 3 * MIN);
assert.deepEqual(s.summary(4 * MIN).state, { word: 'ready for duty', since: 2.5 * MIN });
});
test('a ready from before the server started counts, if the server saw no outage', () => {
const s = new Status(dayOf);
s.record({ at: 1 * MIN, kind: 'ready', source: 'pdtv26-button' });
s.check('box', true, 10 * MIN);
s.beat(10.5 * MIN);
assert.deepEqual(s.summary(11 * MIN).state, { word: 'ready for duty', since: 1 * MIN });
});
test('checks keep when they last changed', () => {
const s = new Status(dayOf);
s.check('brain', true, 1 * MIN);