mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-10 20:50:08 +02:00
Wait for restart backup cleanup before ending startup tests
The retry marker is removed before its directory sync and work receipt finish. Wait for both the marker and active-work count so the next startup test cannot overlap unfinished backup persistence. Verified all 35 server startup tests. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
9492108632
commit
5b1de388ef
1 file changed
+6
-1
@@ -488,8 +488,13 @@ describe("startServer feedback export wiring", () => {
|
||||
if (fails) {
|
||||
vi.mocked(runDatabaseBackup).mockImplementationOnce(writeBackup);
|
||||
expect(retry).toEqual(expect.any(Function));
|
||||
const activeBeforeRetry = idleWorkSnapshot().active;
|
||||
retry!();
|
||||
await vi.waitFor(() => expect(existsSync(idleBackupWakeMarker(directory))).toBe(false));
|
||||
await vi.waitFor(() => {
|
||||
expect(existsSync(idleBackupWakeMarker(directory))).toBe(false);
|
||||
// Marker removal precedes directory fsync and release of the work receipt.
|
||||
expect(idleWorkSnapshot().active).toBe(activeBeforeRetry);
|
||||
});
|
||||
expect(runDatabaseBackup).toHaveBeenCalledTimes(2);
|
||||
}
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user