fix: resolve workspace teardown race with persistence fence
This commit is contained in:
parent
a69022756a
commit
dba6a88a28
5 changed files with 39 additions and 10 deletions
|
|
@ -191,6 +191,7 @@ import {
|
|||
stopAgentDispatcher,
|
||||
isSidecarAlive,
|
||||
setSidecarAlive,
|
||||
waitForPendingPersistence,
|
||||
} from './agent-dispatcher';
|
||||
|
||||
// Stop any previous dispatcher between tests so `unlistenMsg` is null and start works
|
||||
|
|
@ -601,4 +602,11 @@ describe('agent-dispatcher', () => {
|
|||
}));
|
||||
});
|
||||
});
|
||||
|
||||
describe('waitForPendingPersistence', () => {
|
||||
it('resolves immediately when no persistence is in-flight', async () => {
|
||||
vi.useRealTimers();
|
||||
await expect(waitForPendingPersistence()).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue