Keep invalid container states from dropping host heartbeats
This commit is contained in:
@@ -15,6 +15,19 @@ async function enrolled() {
|
||||
}
|
||||
|
||||
describe('native host enrollment and scoped authentication', () => {
|
||||
it('keeps the host online and delivers work when individual state observations are invalid', async () => {
|
||||
const api = await enrolled();
|
||||
const good = { instanceId: 'healthy-server', generation: 1, state: 'running', healthy: true, observedAt: new Date().toISOString() };
|
||||
const operation = api.queueHostOperation(api.host.id, 'host.inspect', {});
|
||||
const host = api.heartbeat(api.host.id, { ...inventory, instanceStates: [good,
|
||||
{ ...good, instanceId: 'crashing', state: 'restarting' },
|
||||
{ ...good, instanceId: 'paused', state: 'paused' }, null,
|
||||
{ ...good, generation: 0 }, { ...good, observedAt: 'invalid' }] });
|
||||
expect(host.inventory.instanceStates).toEqual([good]);
|
||||
expect(host.readiness).toBe('ready');
|
||||
expect(api.pendingHostOperations(api.host.id).map(row => row.id)).toContain(operation.id);
|
||||
});
|
||||
|
||||
it('queues serialized launch files and processes receipts without hydrating plugin payloads', async () => {
|
||||
const api = await enrolled();
|
||||
const { db } = await import('../../src/lib/server/db/index.js');
|
||||
|
||||
Reference in New Issue
Block a user