Skip to content

Commit

Permalink
We need to wait for the deposit to finish!
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcrane committed Sep 11, 2024
1 parent 89047dd commit 3a56fb9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions LeedsPrototypeTests/tests/exporting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@ test.describe('Export an existing Digital Object and make changes to it, then cr
});
const exportDeposit = await exportResp.json();
expect(exportDeposit.files).toMatch(/s3:\/\/.*/);
console.log("The files for " + digitalObjectUri + " have been placed under " + exportDeposit.files);

console.log("The files for " + digitalObjectUri + " will be placed under " + exportDeposit.files);
console.log("But we need to wait for the export to finish! It might take a long time");
await expect.poll(async () => {
console.log("GET the export deposit: " + exportDeposit['@id']);
const exDepReq = await request.get(exportDeposit['@id']);
const exDep = await exDepReq.json();
console.log("status: " + exDep.status);
return exDep.status;
}, {
intervals: [2000], // every 2 seconds
timeout: 60000 // allow 1 minute to complete
}).toMatch("ready");

const s3Client = getS3Client();
await listKeys(s3Client, exportDeposit.files);
Expand Down

0 comments on commit 3a56fb9

Please sign in to comment.