mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-10-30 17:27:09 +00:00
test(cli): time each native Sharp call in the flaky Windows contact-sheet test (#4070)
This test has hit its 60s ceiling on Windows CI runners before, and the log only ever shows the bare timeout, not which of the four native Sharp calls actually stalled. Wrapping each one in console.time/console.timeEnd costs nothing when the test is fast and names the slow step the next time it isn't. No behavior change.
This commit is contained in:
@@ -27,6 +27,7 @@ describe("createContactSheet", () => {
|
||||
const a = join(dir, "a.png");
|
||||
const b = join(dir, "b.png");
|
||||
const out = join(dir, "sheet.png");
|
||||
console.time("sharp.toFile(a)");
|
||||
await sharp({
|
||||
create: {
|
||||
width: 16,
|
||||
@@ -37,6 +38,8 @@ describe("createContactSheet", () => {
|
||||
})
|
||||
.png()
|
||||
.toFile(a);
|
||||
console.timeEnd("sharp.toFile(a)");
|
||||
console.time("sharp.toFile(b)");
|
||||
await sharp({
|
||||
create: {
|
||||
width: 16,
|
||||
@@ -47,7 +50,9 @@ describe("createContactSheet", () => {
|
||||
})
|
||||
.png()
|
||||
.toFile(b);
|
||||
console.timeEnd("sharp.toFile(b)");
|
||||
|
||||
console.time("createContactSheet");
|
||||
await createContactSheet([a, b], out, {
|
||||
cols: 2,
|
||||
cellWidth: 16,
|
||||
@@ -55,8 +60,11 @@ describe("createContactSheet", () => {
|
||||
labels: ["A", "B"],
|
||||
maxImages: 2,
|
||||
});
|
||||
console.timeEnd("createContactSheet");
|
||||
|
||||
console.time("sharp(out).metadata()");
|
||||
await expect(sharp(out).metadata()).resolves.toMatchObject({ format: "png" });
|
||||
console.timeEnd("sharp(out).metadata()");
|
||||
} finally {
|
||||
rmSync(dir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user