Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 96b5252

Browse files
authored
test: Fix the reaper and simplify the instance and backup deletion (#1597)
* Simplify the instance and backup deletion * test: Fix the reaper and simplify the instance and backup deletion
1 parent e50b67d commit 96b5252

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

system-test/bigtable.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ describe('Bigtable', () => {
6969
const oneHourAgo = new Date(Date.now() - 3600000);
7070
return !timeCreated || timeCreated <= oneHourAgo;
7171
});
72-
const q = [];
7372
// need to delete backups first due to instance deletion precondition
74-
await Promise.all(testInstances.map(instance => reapBackups(instance)));
75-
await Promise.all(
76-
testInstances.map(instance => {
77-
q.push(async () => {
78-
try {
79-
await instance.delete();
80-
} catch (e) {
81-
console.log(`Error deleting instance: ${instance.id}`);
82-
}
83-
});
84-
}),
73+
const deleteBackupPromises = testInstances.map(instance =>
74+
reapBackups(instance),
8575
);
76+
for (const backupPromise of deleteBackupPromises) {
77+
await backupPromise;
78+
}
79+
for (const instance of testInstances) {
80+
try {
81+
await instance.delete();
82+
} catch (e) {
83+
console.log(`Error deleting instance: ${instance.id}`);
84+
}
85+
}
8686
}
8787

8888
before(async () => {

0 commit comments

Comments
 (0)