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 bd2efb7 commit b6d7b82
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void clear() {
@DisplayName("동시에 30개 요청이 들어와도 각각 다른 대기번호를 부여한다.")
@Test
void createWaitingNumberConcurrency() throws InterruptedException {
int threadCount = 30;
ExecutorService executorService = Executors.newFixedThreadPool(32);
int threadCount = 10;
ExecutorService executorService = Executors.newFixedThreadPool(5);
CountDownLatch latch = new CountDownLatch(
threadCount); // 다른 thread에서 수행 중인 작업이 완료될 때까지 대기할 수 있도록 돕는 클래스

Expand All @@ -85,7 +85,9 @@ void createWaitingNumberConcurrency() throws InterruptedException {

int waitingCount = shopRepository.findAll().get(0)
.getWaitingCount();

assertEquals(30, waitingCount);
if (waitingCount!=10){
throw new RuntimeException("waitingCount =" + waitingCount);
}
assertEquals(threadCount, waitingCount);
}
}

0 comments on commit b6d7b82

Please sign in to comment.