From db68bffd4e027aa37a9c010a17f84caa20c60f2c Mon Sep 17 00:00:00 2001 From: Raya Straus Date: Tue, 14 Jul 2020 14:43:34 +0300 Subject: [PATCH 1/2] Added retry --- test/integration/api/admin/api_spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/api/admin/api_spec.js b/test/integration/api/admin/api_spec.js index 01984293..ac1a2587 100644 --- a/test/integration/api/admin/api_spec.js +++ b/test/integration/api/admin/api_spec.js @@ -1043,6 +1043,8 @@ describe("api", function () { it('should restore different versions of a deleted asset', async function () { this.timeout(TIMEOUT.LARGE); + this.retries(3); + // Upload the same file twice (upload->delete->upload->delete) // Upload and delete a file From 6d2c7d73bb975b4873d265baaafdc2f0d0f04dcb Mon Sep 17 00:00:00 2001 From: Raya Straus Date: Sun, 19 Jul 2020 14:33:33 +0300 Subject: [PATCH 2/2] Added wait time --- test/integration/api/admin/api_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/api/admin/api_spec.js b/test/integration/api/admin/api_spec.js index ac1a2587..b5f899cf 100644 --- a/test/integration/api/admin/api_spec.js +++ b/test/integration/api/admin/api_spec.js @@ -1043,7 +1043,6 @@ describe("api", function () { it('should restore different versions of a deleted asset', async function () { this.timeout(TIMEOUT.LARGE); - this.retries(3); // Upload the same file twice (upload->delete->upload->delete) @@ -1059,7 +1058,7 @@ describe("api", function () { await wait(1000)(); const secondDelete = await API_V2.delete_resources([PUBLIC_ID_BACKUP_1]); - + await wait(1000)(); // Sanity, ensure these uploads are different before we continue expect(firstUpload.bytes).not.to.equal(secondUpload.bytes); @@ -1084,6 +1083,7 @@ describe("api", function () { expect(firstVerRestore[PUBLIC_ID_BACKUP_1].bytes).to.eql(firstUpload.bytes); // Restore second version, ensure it's equal to the upload size + await wait(1000)(); const secondVerRestore = await API_V2.restore([PUBLIC_ID_BACKUP_1], { versions: [secondAssetVersion] }); expect(secondVerRestore[PUBLIC_ID_BACKUP_1].bytes).to.eql(secondUpload.bytes);