Fix false stale Fleet reports caused by clock skew

This commit is contained in:
2026-09-19 20:17:43 -04:00
parent 345839fbd4
commit 1d073779fe
9 changed files with 224 additions and 15 deletions
+9
View File
@@ -27,6 +27,15 @@ async function setup() {
}
describe('database fleet and container readiness', () => {
it('includes the server clock with the health snapshot', async () => {
await setup();
const { GET } = await import('../../src/routes/api/servers/+server.js');
const requestedAt = Date.now();
const snapshot = await (await GET()).json();
expect(snapshot.serverNow).toBeGreaterThanOrEqual(requestedAt);
expect(snapshot.serverNow).toBeLessThanOrEqual(Date.now());
});
it('lists registered servers without folders and ignores unregistered folders and tombstones', async () => {
const { db } = await setup();
const { allServers, listServers } = await import('../../src/lib/server/fleet/servers.js');