Let agents idle for updates required by creation cancellation

This commit is contained in:
2026-10-04 18:14:11 -04:00
parent 176b7dd86b
commit fae7775c72
5 changed files with 65 additions and 2 deletions
+6
View File
@@ -142,6 +142,12 @@ describe('native instance provisioning', () => {
expect(pendingHostOperations(hostId).filter(op => op.kind.startsWith('instance.'))).toEqual([]);
await advance();
expect((await detail(cleanup)).stage).toContain('Update the host agent');
expect((await detail(cleanup)).stage).toContain('Automatic updates are not enabled');
heartbeat(hostId, { ...inventory(), capabilities: ['agent.update'],
agentUpdate: { enabled: true, state: 'deferred', currentVersion: '1.2.2', targetVersion: '1.3.0' } });
await advance();
expect((await detail(cleanup)).stage).toContain('New command delivery is paused');
expect((await detail(cleanup)).stage).toContain('automatic updater can run');
db().prepare('UPDATE ec_hosts SET last_heartbeat=? WHERE id=?').run('2000-01-01T00:00:00.000Z', hostId);
await advance();
expect((await detail(cleanup)).stage).toContain('unavailable');