Skip to content

Commit 1e9a706

Browse files
committed
fix: use Promise.race for 1s to avoid haning listTables commands
1 parent a778e00 commit 1e9a706

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ module.exports = async function () {
3131
global.__DYNAMODB_CLIENT__ = dynamoDB;
3232

3333
try {
34-
const {TableNames: tableNames} = await dynamoDB.listTables().promise();
34+
const {TableNames: tableNames} = await Promise.race([
35+
dynamoDB.listTables().promise(),
36+
new Promise(resolve => setTimeout(resolve, 1000))
37+
]);
3538
await deleteTables(dynamoDB, tableNames); // cleanup leftovers
3639
} catch (err) {
3740
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)