Fix two intermittently failing library tests (closes #90)
check / check (push) Successful in 27s
check / check (push) Successful in 27s
Library.close() now returns a promise that resolves once the work it started has finished: an in-flight refresh with its cache write, the ML data fetch, and running precache sweeps. The interval test could see a refresh's new state, close, and remove the directory while the write was still running. Every library test and CLI command now awaits close(), and tests hold each of the three writes open to prove close() waits for it. The precache test waited for its stub source to be called, but the cache records a file only after checking it on disk, so status() could lag. It now waits for both fills to report "done". Model: opus-5-5
This commit was merged in pull request #92.
This commit is contained in:
+8
-8
@@ -194,7 +194,7 @@ export const collectionsCommand = async (
|
||||
}
|
||||
return 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -235,7 +235,7 @@ export const filesCommand = async (
|
||||
}
|
||||
return 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -272,7 +272,7 @@ export const getCommand = async (
|
||||
ctx.stderr.write(`${result.bytes} bytes -> ${outPath}\n`);
|
||||
return 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -309,7 +309,7 @@ export const getThumbCommand = async (
|
||||
ctx.stderr.write(`${result.bytes} bytes -> ${outPath}\n`);
|
||||
return 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -329,7 +329,7 @@ export const backupMetadataCommand = async (
|
||||
});
|
||||
return 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -376,7 +376,7 @@ export const backupCommand = async (
|
||||
|
||||
return result.failed > 0 ? 1 : 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -411,7 +411,7 @@ export const listMissingThumbnailsCommand = async (
|
||||
}
|
||||
return 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -481,6 +481,6 @@ export const fixMissingThumbnailsCommand = async (
|
||||
|
||||
return results.some((r) => r.status === "failed") ? 1 : 0;
|
||||
} finally {
|
||||
lib.close();
|
||||
await lib.close();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user