Fix false stale Fleet reports caused by clock skew
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user