fix(pi): settle delayed compact ownership
This commit is contained in:
@@ -510,8 +510,8 @@ describe('Pi Conversation runtime', () => {
|
||||
expect((await runtime.getSnapshot(right.id)).run.status).toBe('error');
|
||||
expect(activeBackgroundLeases).toBe(0);
|
||||
await runtime.compact(right.id);
|
||||
expect((await runtime.getSnapshot(right.id)).run.status).toBe('compacting');
|
||||
expect(activeBackgroundLeases).toBe(1);
|
||||
await expect.poll(async () => (await runtime.getSnapshot(right.id)).run.status).toBe('idle');
|
||||
expect(activeBackgroundLeases).toBe(0);
|
||||
expect(workers.get(right.id)!.requests.at(-1)).toEqual({ type: 'compact' });
|
||||
expect((await runtime.getSnapshot(left.id)).run.status).toBe('idle');
|
||||
const rightDurable = {
|
||||
@@ -529,7 +529,7 @@ describe('Pi Conversation runtime', () => {
|
||||
durableSessions.set(right.id, rightDurable);
|
||||
workers.get(right.id)!.setSessionData(rightDurable);
|
||||
workers.get(right.id)!.emit({ type: 'agent_end' });
|
||||
expect((await runtime.getSnapshot(right.id)).run.status).toBe('compacting');
|
||||
expect((await runtime.getSnapshot(right.id)).run.status).toBe('idle');
|
||||
workers.get(right.id)!.emit({ type: 'agent_settled' });
|
||||
await expect.poll(async () => (await runtime.getSnapshot(right.id)).run.status).toBe('idle');
|
||||
expect(activeBackgroundLeases).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user