Skip to content

Commit b791d55

Browse files
authored
fix(test): resolve intermittent timeout in organization-user test (#7645)
1 parent 3168400 commit b791d55

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/integration-tests/src/tests/api/organization/organization-user.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ describe('organization user APIs', () => {
1414

1515
beforeAll(async () => {
1616
const organization = await organizationApi.create({ name: 'test' });
17-
const createdUsers = await Promise.all(
18-
Array.from({ length: 30 }).map(async () => userApi.create({ username: generateTestName() }))
19-
);
17+
// Create users sequentially to avoid database connection pool exhaustion
18+
const createdUsers = [];
19+
for (const _index of Array.from({ length: 30 })) {
20+
// eslint-disable-next-line no-await-in-loop
21+
const user = await userApi.create({ username: generateTestName() });
22+
// eslint-disable-next-line @silverhand/fp/no-mutating-methods
23+
createdUsers.push(user);
24+
}
2025
await organizationApi.addUsers(
2126
organization.id,
2227
createdUsers.map((user) => user.id)

0 commit comments

Comments
 (0)