test(deploy): allow slower display uploads
CI / verify (pull_request) Successful in 1m8s
CI / infrastructure-smoke (pull_request) Successful in 35s
CI / migration-smoke (pull_request) Successful in 1m57s
CI / package-release (pull_request) Successful in 37s
CI / image-build (pull_request) Successful in 54s
CI / deploy-smoke (same-origin) (pull_request) Successful in 50s
CI / deploy-smoke (split) (pull_request) Successful in 2m21s
CI / package-publication (pull_request) Successful in 52s
CI / verify (pull_request) Successful in 1m8s
CI / infrastructure-smoke (pull_request) Successful in 35s
CI / migration-smoke (pull_request) Successful in 1m57s
CI / package-release (pull_request) Successful in 37s
CI / image-build (pull_request) Successful in 54s
CI / deploy-smoke (same-origin) (pull_request) Successful in 50s
CI / deploy-smoke (split) (pull_request) Successful in 2m21s
CI / package-publication (pull_request) Successful in 52s
This commit is contained in:
@@ -435,14 +435,22 @@ async function seedSignage(owner) {
|
||||
context.fillStyle = ${JSON.stringify(colour)};
|
||||
context.fillRect(0, 0, 640, 360);
|
||||
const blob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
|
||||
const response = await fetch(${JSON.stringify(`${apiOrigin}${base}/images?filename=slide-${index}.png&displayName=Slide%20${index}`)}, {
|
||||
return fetch(${JSON.stringify(`${apiOrigin}${base}/images?filename=slide-${index}.png&displayName=Slide%20${index}`)}, {
|
||||
body: blob, credentials: "include", headers: { "content-type": "image/png" }, method: "POST",
|
||||
signal: AbortSignal.timeout(${requestTimeoutMs}),
|
||||
});
|
||||
return { status: response.status, body: await response.json().catch(() => null) };
|
||||
}).then(
|
||||
async (response) => ({ status: response.status, body: await response.json().catch(() => null) }),
|
||||
(error) => ({ status: error && error.name === "TimeoutError" ? "timeout" : "network-error" }),
|
||||
);
|
||||
})()`,
|
||||
`uploading slide ${index}`,
|
||||
);
|
||||
if (uploaded.status === "timeout") {
|
||||
throw new HangError(`HTTP POST ${base}/images from page "owner"`, requestTimeoutMs);
|
||||
}
|
||||
if (uploaded.status !== 200 && uploaded.status !== 201) {
|
||||
throw new Error(`Uploading slide ${index} returned HTTP ${uploaded.status}.`);
|
||||
}
|
||||
images.push(uploaded.body?.image?.id);
|
||||
}
|
||||
check(
|
||||
|
||||
Reference in New Issue
Block a user