Skip to content

Commit

Permalink
fix : 테스트 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun2371 committed Jan 17, 2024
1 parent d9cd43d commit fa4128f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,15 @@ void clear() {
@Test
void createWaitingNumberConcurrency() throws InterruptedException {
int threadCount = 30;
ExecutorService executorService = Executors.newFixedThreadPool(15);
ExecutorService executorService = Executors.newFixedThreadPool(30);
CountDownLatch latch = new CountDownLatch(
threadCount); // 다른 thread에서 수행 중인 작업이 완료될 때까지 대기할 수 있도록 돕는 클래스
int a = 1;
for (int i = 0; i < threadCount; i++) {
Member member = MemberFixture.member(String.format("hyun%d@gmail.com",
i)); // validateMemberWaitingExists 오류 안 나도록 (한 기기 당 한 회원 웨이팅 생성)
memberRepository.save(member);
if (a==1){
throw new RuntimeException("executorService 전");
}
//여기까지는 실행됨
executorService.submit(() -> {
if (a==1){
throw new RuntimeException("memberWaitingService전");
Expand Down

0 comments on commit fa4128f

Please sign in to comment.