From d23940e3afe7d082d205d92e6b2bb820bd506279 Mon Sep 17 00:00:00 2001 From: rpletz Date: Wed, 13 Nov 2024 13:31:23 -0800 Subject: [PATCH 1/3] Increase test retry --- config/jest/jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/jest/jest.config.js b/config/jest/jest.config.js index 3ab4568ab..1aeaf6c8b 100644 --- a/config/jest/jest.config.js +++ b/config/jest/jest.config.js @@ -50,4 +50,5 @@ module.exports = { '/test/testSetup.js', ], testTimeout: 100000, + testRetryTimes: 3, }; From b895eb45d244a01b74ecd61e8d0153ef3dd5e0e3 Mon Sep 17 00:00:00 2001 From: rpletz Date: Wed, 13 Nov 2024 13:35:43 -0800 Subject: [PATCH 2/3] Set retries --- config/jest/jest.config.js | 1 - test/testSetup.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/jest/jest.config.js b/config/jest/jest.config.js index 1aeaf6c8b..3ab4568ab 100644 --- a/config/jest/jest.config.js +++ b/config/jest/jest.config.js @@ -50,5 +50,4 @@ module.exports = { '/test/testSetup.js', ], testTimeout: 100000, - testRetryTimes: 3, }; diff --git a/test/testSetup.js b/test/testSetup.js index 6a899f89f..b9be0e737 100644 --- a/test/testSetup.js +++ b/test/testSetup.js @@ -6,6 +6,8 @@ CONFIG.set('env', 'test'); const {managerUsername, bioinformaticianUsername} = CONFIG.get('testing'); beforeAll(async () => { + jest.retryTimes(5, {logErrorsBeforeRetry: true}); + const [managerUser] = await db.models.user.findOrCreate({ where: { username: managerUsername, From 04985be2607580fc3e9224dac60d13f24d0c6a86 Mon Sep 17 00:00:00 2001 From: rpletz Date: Wed, 13 Nov 2024 13:38:40 -0800 Subject: [PATCH 3/3] Remove force true --- test/routes/report/signatureVariants.test.js | 6 +++--- test/testSetup.js | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/routes/report/signatureVariants.test.js b/test/routes/report/signatureVariants.test.js index f4eaa06ac..f7a254065 100644 --- a/test/routes/report/signatureVariants.test.js +++ b/test/routes/report/signatureVariants.test.js @@ -124,7 +124,7 @@ describe('/reports/{REPORTID}/sigv', () => { }); afterEach(async () => { - await db.models.signatureVariants.destroy({where: {ident: sigvUpdate.ident}, force: true}); + await db.models.signatureVariants.destroy({where: {ident: sigvUpdate.ident}}); }); test('/{sigv} - 200 Success', async () => { @@ -169,7 +169,7 @@ describe('/reports/{REPORTID}/sigv', () => { }); afterEach(async () => { - await db.models.signatureVariants.destroy({where: {ident: sigvDelete.ident}, force: true}); + await db.models.signatureVariants.destroy({where: {ident: sigvDelete.ident}}); }); test('/{sigv} - 204 No content', async () => { @@ -201,7 +201,7 @@ describe('/reports/{REPORTID}/sigv', () => { afterAll(async () => { // delete newly created report and all of it's components // indirectly by hard deleting newly created patient - report.destroy({force: true}); + report.destroy(); }); }); diff --git a/test/testSetup.js b/test/testSetup.js index b9be0e737..6a899f89f 100644 --- a/test/testSetup.js +++ b/test/testSetup.js @@ -6,8 +6,6 @@ CONFIG.set('env', 'test'); const {managerUsername, bioinformaticianUsername} = CONFIG.get('testing'); beforeAll(async () => { - jest.retryTimes(5, {logErrorsBeforeRetry: true}); - const [managerUser] = await db.models.user.findOrCreate({ where: { username: managerUsername,