From 302daff589ab3962f93ced2dda6f39291a15ca84 Mon Sep 17 00:00:00 2001 From: Ellen Kraffmiller Date: Tue, 19 Dec 2023 10:13:30 -0500 Subject: [PATCH] fix: removed code that is now in datasetHelper.ts --- .../datasets/DatasetsRepository.test.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/test/integration/datasets/DatasetsRepository.test.ts b/test/integration/datasets/DatasetsRepository.test.ts index aeb1571c..bc813161 100644 --- a/test/integration/datasets/DatasetsRepository.test.ts +++ b/test/integration/datasets/DatasetsRepository.test.ts @@ -112,17 +112,10 @@ describe('DatasetsRepository', () => { }); await waitForNoLocks(createdDatasetId, 10) - let locks = await sut.getDatasetLocks(createdDatasetId); - const maxTries = 10; - let tries = 0; - while (locks.length > 0 && tries < maxTries) { - await new Promise(resolve => setTimeout(resolve, 1000)); - locks = await sut.getDatasetLocks(createdDatasetId); - tries++ - } - if (tries >= maxTries && locks.length > 0) { - assert.fail('Error while waiting for locks to be released'); - } + .then() + .catch(() => { + assert.fail('Error while waiting for no locks'); + }); await deaccessionDatasetViaApi(createdDatasetId,'1.0') .then() .catch((error) => {