backend-app-api: fix race end DatabaseKeyStore tests

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-04-05 17:01:09 +02:00
parent 318c0b760a
commit d627a67acf
@@ -102,6 +102,9 @@ describe('DatabaseKeyStore', () => {
"Removing expired plugin service keys, 'test-key-2'",
);
// Key deletion happens async, so give it a bit of time to complete
await new Promise(resolve => setTimeout(resolve, 500));
await expect(knex(TABLE).select('id')).resolves.toEqual([
{ id: testKey.kid },
]);