Reconcile host preparation on heartbeats instead of polls
This commit is contained in:
@@ -183,6 +183,14 @@ describe('automatic host preparation', () => {
|
||||
});
|
||||
expect(operations(host.id)).toEqual([]);
|
||||
|
||||
// Poll lanes only deliver queued work. One inventory heartbeat drives setup.
|
||||
const reconcile = vi.spyOn(preparation, 'reconcileHostPreparation');
|
||||
expect((await (await pollOperations({ request: request('operations') })).json()).operations).toEqual([]);
|
||||
expect(reconcile).not.toHaveBeenCalled();
|
||||
expect((await reportHeartbeat({ request: request('heartbeat', { inventory }) })).status).toBe(200);
|
||||
expect(reconcile).toHaveBeenCalledOnce();
|
||||
reconcile.mockRestore();
|
||||
|
||||
const firstPoll = await (await pollOperations({ request: request('operations') })).json();
|
||||
expect(firstPoll.operations).toHaveLength(1);
|
||||
const runtimeOperation = firstPoll.operations[0];
|
||||
|
||||
Reference in New Issue
Block a user