Skip to content

Commit 8bc2dfd

Browse files
Merge pull request #91 from Palbahngmiyine/dev
GroupService E2E 테스트에서 그룹 삭제 상태 검증 로직을 retryUntil로 리팩토링
2 parents 3af2c74 + b8ff6ee commit 8bc2dfd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

test/services/messages/groupService.e2e.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {RequestSendOneMessageSchema} from '@models/requests/messages/sendMessage';
22
import {beforeAll, describe, expect, it} from 'vitest';
33
import GroupService from '@/services/messages/groupService';
4-
import {retryWithBackoff} from '../../lib/retry-utils';
4+
import {retryUntil, retryWithBackoff} from '../../lib/retry-utils';
55

66
describe('GroupService E2E', () => {
77
let groupService: GroupService;
@@ -55,10 +55,11 @@ describe('GroupService E2E', () => {
5555
// 4. Delete the group
5656
await groupService.removeGroup(groupId);
5757

58-
// 5. Verify the group is deleted (retry to handle eventual consistency)
59-
const removedGroupInfo = await retryWithBackoff(
58+
// 5. Verify the group is deleted (retry until status becomes DELETED)
59+
const removedGroupInfo = await retryUntil(
6060
() => groupService.getGroup(groupId),
61-
{maxRetries: 5, initialDelayMs: 200},
61+
info => info.status === 'DELETED',
62+
{maxRetries: 10, initialDelayMs: 200},
6263
);
6364
expect(removedGroupInfo.status).toBe('DELETED');
6465
});

0 commit comments

Comments
 (0)