Skip to content

Conversation

@taek2222
Copy link
Contributor

@taek2222 taek2222 commented Dec 26, 2025

#️⃣ 이슈 번호

#29


🛠️ 작업 내용

  • Helper Tomcat Thread Count 로 실행될 수 있도록 변경했습니다.
  • 결과 검증할 때 유용하도록 객체를 생성해 HttpStatus 저장하도록 변경했습니다.
  • 실패 카운트 내부에 처리할 수 있도록 변경했습니다.

🙇🏻 중점 리뷰 요청

  • 최대한 이해할 수 있도록 구체적인 네이밍을 선정했습니다. 부족한 부분 짚어주세요.
  • test의 application.yml 파일에 Tomcat Thread 개수 설정했는데, 이를 main 환경의 서버 튜닝 설정 값을 바라보게 할 지 고민입니다.

Summary by CodeRabbit

릴리스 노트

  • Tests
    • 동시성 테스트 프레임워크를 개선하여 더 효율적인 요청 처리 및 결과 추적이 가능하게 되었습니다.
    • 테스트 헬퍼 유틸리티를 리팩토링하여 HTTP 상태 코드 기반의 자동화된 검증 기능을 추가했습니다.
    • 내부 테스트 인프라 최적화를 통해 테스트 안정성이 향상되었습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • android
  • backend
  • frontend

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'tools'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

동시성 테스트 인프라를 Runnable 기반에서 Callable 기반으로 리팩토링했습니다. ConcurrencyTestHelper는 정적 메서드 test()에서 인스턴스 메서드 execute()로 변경되었으며, 새로운 ConcurrencyTestResult 클래스를 도입하여 HTTP 상태 코드를 스레드 안전하게 기록합니다. 관련 테스트 클래스들이 업데이트되었고, 테스트 설정에서 helper를 의존성 주입받도록 구성했습니다. Tomcat 스레드 풀 설정(최대 15개)도 추가되었습니다.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes


상세 분석

주요 변경 지점별 검토 사항

1. ConcurrencyTestHelper의 아키텍처 변경

이 변경은 정적 메서드에서 Spring 컴포넌트로 전환하는 상당한 패러다임 전환입니다. 몇 가지 검토할 점들이 있습니다:

문제점:

  • 기존 test(int requestCount, Runnable...) 메서드가 requestCount 파라미터를 받던 방식에서, 이제는 ${server.tomcat.threads.max} 설정값에 의존합니다. 이로 인해 테스트의 동시성 수준이 설정 파일과 강하게 결합되어, 설정 변경 시 테스트 동작이 영향받을 수 있습니다.
  • 테스트마다 스레드 개수를 동적으로 조정하던 유연성이 사라졌습니다.

개선 고려사항:

  • 옵션 A: 설정값을 그대로 사용하되, 필요시 생성자나 setter로 스레드 수를 오버라이드할 수 있는 메서드 제공
  • 옵션 B: execute() 메서드에 선택적 파라미터로 스레드 수를 명시적으로 지정할 수 있도록 확장 (기본값은 설정, 필요시 오버라이드)

2. 예외 처리의 단순화

catch (Exception e) {
    log.error("요청 실행 중 예외 발생", e);
}

이 접근은 예외를 로깅만 하고 계속 진행하는 방식입니다.

한계점:

  • 예외가 발생했을 때 이를 명시적으로 결과에 기록하지 않습니다. 따라서 모든 요청이 정상 상태 코드를 반환한 것처럼 집계될 수 있습니다.
  • 테스트가 조용히 실패할 위험이 있습니다.

권장 개선:

  • 예외 발생 시 ConcurrencyTestResult에 실패 상태(예: 500 또는 전용 상태)를 기록하거나, 별도의 "예외 발생" 카운터를 추가하는 것이 좋습니다.

3. ConcurrencyTestResult의 스레드 안전성

ConcurrentHashMap과 AtomicLong을 사용한 구현은 기본적으로 잘 설계되었으나:

검토 사항:

  • getSuccessCount()가 모든 2xx 상태를 합산하는데, 이 과정에서 map 순회 중 다른 스레드가 값을 수정할 수 있습니다. 결과적으로 읽는 순간의 정확한 스냅샷을 보장하지 못할 수 있습니다.

선택지:

  • 옵션 A: 현재 상태 유지 (대부분의 경우 실용적)
  • 옵션 B: 읽기 시점에 synchronized 블록 추가 또는 스냅샷 메서드 제공하여 일관성 보장

4. 테스트 코드 마이그레이션의 일관성

AnnouncementControllerTest와 FestivalNotificationConcurrencyTest의 마이그레이션 패턴이 약간 다릅니다.

관찰:

  • FestivalNotificationConcurrencyTest에서는 successCount == 1conflictCount == totalRequests - 1 식으로 결과를 검증합니다. 이는 특정한 동시성 동작(낙관적 잠금 충돌)을 테스트하는 의도가 명확합니다.
  • 다른 테스트들도 이런 명확한 assertion 패턴을 일관되게 적용하는지 확인이 필요합니다.

5. 설정 파일의 Tomcat 스레드 수

server.tomcat.threads.max: 15를 추가했는데, 이 값이 실제 동시성 테스트 의도와 일치하는지 검증 필요합니다.

확인할 점:

  • 이 값으로 기존 테스트가 충분히 높은 동시성을 유지하는지
  • CI/CD 환경과 로컬 개발 환경에서 스레드 풀 크기가 다를 경우 테스트 결과 변동성 가능성

종합 평가

이번 리팩토링은 동시성 테스트를 더 선언적이고 결과 기반으로 전환하려는 긍정적인 방향입니다. 다만 위의 예외 처리 개선과 설정 값 검증, 그리고 필요시 동시성 수준을 테스트별로 조정할 수 있는 유연성 추가가 있으면 더욱 견고할 것 같습니다.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PR의 주요 변경 사항(Tomcat 스레드 수 기반 동시성 테스트 리팩토링)을 명확하게 반영하고 있으며, 기술적으로 구체적입니다.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@taek2222
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link

Overall Project 93.41% 🍏

There is no coverage information present for the Files changed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the concurrency testing infrastructure to align thread counts with Tomcat's configuration and improve result tracking. The helper class is converted from a static utility to a Spring component that reads the Tomcat thread pool size from configuration, ensuring tests simulate realistic server concurrency limits.

Key Changes:

  • Converted ConcurrencyTestHelper from static utility to Spring component with configurable thread count
  • Introduced ConcurrencyTestResult class to track HTTP status codes and request counts across concurrent executions
  • Changed test request signature from Runnable to Callable<Response> to capture HTTP responses

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/test/resources/application.yml Adds Tomcat max threads configuration (15) for test environment
src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java New class to aggregate and track HTTP status codes from concurrent requests
src/test/java/com/daedan/festabook/support/AcceptanceTestSupport.java Imports and autowires ConcurrencyTestHelper as a Spring bean for use in tests
src/test/java/com/daedan/festabook/global/lock/ConcurrencyTestHelper.java Refactored to Spring component with @value injection, returns ConcurrencyTestResult, and uses thread pool sized to Tomcat config
src/test/java/com/daedan/festabook/festival/service/FestivalNotificationConcurrencyTest.java Updated to use new helper API and verify results through ConcurrencyTestResult assertions
src/test/java/com/daedan/festabook/announcement/controller/AnnouncementControllerTest.java Updated to use new Callable-based API but doesn't yet verify returned results

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java (1)

22-31: 반환 타입 일관성 검토

getSuccessCount()int를 반환하고 getRequestCount()long을 반환합니다. FestivalNotificationConcurrencyTest의 67번 라인에서 result.getRequestCount() - result.getSuccessCount()처럼 두 값을 함께 사용할 때, 암묵적 형변환이 발생합니다.

기능상 문제는 없지만, API 일관성을 위해 두 메서드의 반환 타입을 통일하는 것을 고려해볼 수 있습니다.

🔎 타입 통일 제안
     public int getSuccessCount() {
-        return statusCodeCounts.entrySet().stream()
+        return (int) statusCodeCounts.entrySet().stream()
                 .filter(entry -> entry.getKey().is2xxSuccessful())
                 .mapToInt(Map.Entry::getValue)
                 .sum();
     }

-    public long getRequestCount() {
-        return requestCount.get();
+    public int getRequestCount() {
+        return (int) requestCount.get();
     }

또는 둘 다 long으로 통일:

-    public int getSuccessCount() {
+    public long getSuccessCount() {
         return statusCodeCounts.entrySet().stream()
                 .filter(entry -> entry.getKey().is2xxSuccessful())
-                .mapToInt(Map.Entry::getValue)
+                .mapToLong(Map.Entry::getValue)
                 .sum();
     }
src/test/java/com/daedan/festabook/global/lock/ConcurrencyTestHelper.java (1)

48-51: InterruptedException 처리 방식 개선 권장

현재 InterruptedException을 무시하고 있는데, 이는 인터럽트 상태를 소실시킵니다. 테스트 코드에서는 큰 문제가 되지 않지만, 일반적인 모범 사례는 인터럽트 플래그를 복원하는 것입니다.

이렇게 하면 상위 호출자가 인터럽트 상태를 인지할 수 있어, 향후 테스트 프레임워크나 CI 환경에서 타임아웃 등으로 인한 인터럽트 발생 시 적절한 처리가 가능합니다.

🔎 인터럽트 플래그 복원 제안
         } catch (InterruptedException ignore) {
+            Thread.currentThread().interrupt();
         }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81d226a and 48e8f7b.

📒 Files selected for processing (6)
  • src/test/java/com/daedan/festabook/announcement/controller/AnnouncementControllerTest.java
  • src/test/java/com/daedan/festabook/festival/service/FestivalNotificationConcurrencyTest.java
  • src/test/java/com/daedan/festabook/global/lock/ConcurrencyTestHelper.java
  • src/test/java/com/daedan/festabook/support/AcceptanceTestSupport.java
  • src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java
  • src/test/resources/application.yml
🧰 Additional context used
🧬 Code graph analysis (2)
src/test/java/com/daedan/festabook/global/lock/ConcurrencyTestHelper.java (1)
src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java (1)
  • ConcurrencyTestResult (8-32)
src/test/java/com/daedan/festabook/festival/service/FestivalNotificationConcurrencyTest.java (1)
src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java (1)
  • ConcurrencyTestResult (8-32)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: CodeQL analysis (java)
  • GitHub Check: Run-PR-Test
🔇 Additional comments (7)
src/test/resources/application.yml (1)

34-38: 테스트 환경용 Tomcat 스레드 설정 추가 확인

테스트 환경에서 동시성 테스트의 스레드 풀 크기를 결정하는 설정입니다. PR 목표에서 언급된 것처럼, 이 값이 운영 환경의 서버 튜닝 값과 동일해야 하는지 검토가 필요합니다.

현재 15개로 설정된 값이 동시성 테스트 시나리오에 적합한지, 그리고 운영 환경과의 일관성이 필요한지 팀 내 논의를 권장드립니다. 테스트 목적상 독립적인 값을 유지하는 것도 합리적인 선택입니다.

src/test/java/com/daedan/festabook/announcement/controller/AnnouncementControllerTest.java (1)

457-468: Callable 기반 동시성 테스트 패턴 적용 확인

기존 Runnable 방식에서 Callable<Response> 방식으로 전환하여 HTTP 응답을 직접 수집할 수 있게 되었습니다. 이를 통해 테스트 결과 검증이 더 명확해졌습니다.

다만, 현재 테스트에서는 concurrencyTestHelper.execute(httpRequest)의 반환값인 ConcurrencyTestResult를 활용하지 않고 있습니다. 필요 시 성공/실패 카운트 검증을 추가하면 테스트의 완성도를 높일 수 있습니다.

src/test/java/com/daedan/festabook/support/AcceptanceTestSupport.java (1)

19-26: ConcurrencyTestHelper 의존성 주입 구성 확인

@Import@Autowired를 통해 ConcurrencyTestHelper를 테스트 컨텍스트에 적절히 통합했습니다. protected 접근 제한자를 사용하여 서브클래스에서 직접 접근할 수 있도록 한 점도 기존 패턴(예: festivalNotificationManager)과 일관성을 유지하고 있습니다.

src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java (1)

13-16: recordStatusCode의 원자성 및 스레드 안전성 고려

ConcurrentHashMap.merge()는 단일 키에 대해 원자적이지만, merge()requestCount.incrementAndGet()은 별도의 연산이므로 두 값 사이에 일시적 불일치가 발생할 수 있습니다.

테스트 결과 집계 목적에서는 큰 문제가 되지 않지만, 만약 더 엄격한 일관성이 필요하다면 동기화 블록으로 감싸는 방법을 고려해볼 수 있습니다. 현재 사용 패턴에서는 endLatch.await() 이후에 결과를 조회하므로 실질적인 문제는 없습니다.

src/test/java/com/daedan/festabook/festival/service/FestivalNotificationConcurrencyTest.java (1)

50-68: Callable 기반 동시성 테스트로의 전환 완료

Runnable에서 Callable<Response> 기반으로 잘 전환되었습니다. 테스트 검증 로직이 명확합니다:

  1. DB에 실제로 1개의 알림만 등록되었는지 확인
  2. 성공 응답이 1개인지 확인
  3. CONFLICT 응답 수가 (전체 요청 - 성공)과 일치하는지 확인

이 패턴은 동시성 테스트의 정확성을 높이는 좋은 접근 방식입니다.

src/test/java/com/daedan/festabook/global/lock/ConcurrencyTestHelper.java (2)

54-59: 입력 검증 로직 확인

validateRequests 메서드가 null 및 빈 배열 케이스를 적절히 처리하고 있습니다. @SafeVarargs 어노테이션도 제네릭 가변인자 메서드에 올바르게 적용되었습니다.


26-28: ExecutorService try-with-resources 사용은 안전합니다

프로젝트가 Java 21을 사용 중이므로, ExecutorService를 try-with-resources로 사용하는 것은 완전히 안전합니다. ExecutorService가 AutoCloseable을 구현한 것은 Java 19부터이며, 프로젝트의 Java 버전(21)은 이 요구사항을 충족하고도 남습니다.

이 패턴의 장점은 shutdown()을 명시적으로 호출할 필요가 없다는 점입니다. try-with-resources 블록을 빠져나갈 때 자동으로 리소스가 정리되므로, 스레드 누수를 방지할 수 있습니다. 동시성 테스트에서처럼 정해진 시간 내에 모든 스레드가 종료되어야 하는 경우 특히 유용합니다.

@festabook festabook deleted a comment from coderabbitai bot Dec 26, 2025
@github-actions
Copy link

Overall Project 93.41% 🍏

There is no coverage information present for the Files changed

@taek2222
Copy link
Contributor Author

@coderabbitai 피드백 준 내용 다 반영했어. 확인한 후 다시 리뷰할 부분 짚어줘.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the main ConcurrencyTestHelper class to review implementation
cat src/test/java/com/daedan/festabook/global/lock/ConcurrencyTestHelper.java

Length of output: 2249


🏁 Script executed:

#!/bin/bash
# Read the ConcurrencyTestResult class
cat src/test/java/com/daedan/festabook/support/ConcurrencyTestResult.java

Length of output: 977


🏁 Script executed:

#!/bin/bash
# Read the test configuration to check Tomcat thread settings
cat src/test/resources/application.yml

Length of output: 709


🏁 Script executed:

#!/bin/bash
# Check one of the test files to see how the helper is being used
cat src/test/java/com/daedan/festabook/festival/service/FestivalNotificationConcurrencyTest.java

Length of output: 2786


🏁 Script executed:

#!/bin/bash
# Check the AcceptanceTestSupport to see how helper is injected
cat src/test/java/com/daedan/festabook/support/AcceptanceTestSupport.java

Length of output: 1535


@taek2222, 코드 확인했습니다. 전반적으로 잘 리팩토링되었고, Callable 기반으로 전환하면서 결과 추적이 명확해졌네요. 몇 가지 추가로 검토가 필요한 부분을 정리해드릴게요.

🔍 주요 리뷰 포인트

1. InterruptedException 처리 개선 필요

위치: ConcurrencyTestHelper.java Line 45

} catch (InterruptedException ignore) {
}

문제점:

  • InterruptedException을 완전히 무시하면 스레드 인터럽트 상태가 소실됩니다.
  • 테스트가 중단되었을 때 디버깅이 어려워질 수 있습니다.

개선 방안:

} catch (InterruptedException e) {
    Thread.currentThread().interrupt();
    log.warn("동시성 테스트 실행이 중단되었습니다.", e);
}

이렇게 하면 인터럽트 플래그를 복원하고, 중단 사실을 로깅해서 추후 디버깅에 도움이 됩니다.


2. 패키지 위치 재고려

위치: ConcurrencyTestHelper 클래스의 패키지

현재: com.daedan.festabook.global.lock

문제점:

  • ConcurrencyTestHelper는 lock 메커니즘과 직접적인 관련이 없고, 테스트 헬퍼 유틸리티입니다.
  • global.lock 패키지명이 오해를 유발할 수 있습니다.

제안:

  • support 패키지로 이동하거나 (com.daedan.festabook.support)
  • 새로운 테스트 헬퍼 전용 패키지 생성 (com.daedan.festabook.test.helper)

ConcurrencyTestResult가 이미 support 패키지에 있으니, 함께 위치시키는 것이 응집도 측면에서 더 나을 것 같습니다.


3. Round-robin 분배 로직 명확화

위치: ConcurrencyTestHelper.java Line 28-29

for (int i = 0; i < tomcatThreadCount; i++) {
    int currentCount = i % requests.length;
    executorService.submit(() -> {
        // requests[currentCount].call()

현재 동작:

  • tomcatThreadCount가 15이고 requests가 1개면, 동일한 요청을 15번 실행
  • requests가 여러 개면 round-robin으로 분배

개선 제안:
메서드 Javadoc이나 주석으로 이 동작을 명확히 설명하면 좋겠습니다:

/**
 * 주어진 요청들을 Tomcat 스레드 수만큼 동시에 실행합니다.
 * 
 * @param requests 실행할 HTTP 요청들. 
 *                 스레드 수가 요청 수보다 많으면 round-robin 방식으로 반복 실행됩니다.
 * @return 실행 결과를 담은 ConcurrencyTestResult
 */
@SafeVarargs
public final ConcurrencyTestResult execute(Callable<Response>... requests) {

4. 테스트 환경 설정값 고려사항

위치: application.yml - server.tomcat.threads.max: 15

고려할 점:

  • 테스트 환경의 스레드 수(15)가 실제 프로덕션 환경과 다를 수 있습니다.
  • 동시성 테스트의 목적이 "실제 부하 시뮬레이션"인지, "동시성 제어 로직 검증"인지에 따라 값이 달라질 수 있습니다.

권장사항:

  1. 동시성 제어 로직 검증이 목적이라면: 현재 15개는 합리적입니다. 너무 크지도 작지도 않은 값으로 중복 방지 로직을 테스트하기 적절합니다.
  2. 실제 부하 시뮬레이션이 목적이라면: 프로덕션 환경의 설정값을 참조하되, 테스트 환경의 리소스 제약을 고려해야 합니다.

현재 코드상으로는 동시성 제어 로직 검증에 초점이 맞춰진 것으로 보이므로, 현재 설정이 적절해 보입니다.


5. ConcurrencyTestResult의 thread-safety 보완 고려

위치: ConcurrencyTestResult.java Line 23-26

public int getSuccessCount() {
    return statusCodeCounts.entrySet().stream()
            .filter(entry -> entry.getKey().is2xxSuccessful())
            .mapToInt(Map.Entry::getValue)
            .sum();
}

현재 상태:

  • ConcurrentHashMap을 사용해서 기본적으로 thread-safe합니다.
  • 하지만 getSuccessCount() 호출 시점에도 다른 스레드에서 상태를 변경할 수 있습니다.

현재 사용 패턴:

  • 실제 테스트 코드를 보면 concurrencyTestHelper.execute() 완료 후에 결과를 조회하므로 문제없습니다.

추가 보완 제안 (선택사항):
만약 실행 중간에도 결과를 조회할 가능성이 있다면, 불변 스냅샷을 반환하는 메서드를 추가할 수 있습니다:

public Map<HttpStatus, Integer> getStatusCodeCountsSnapshot() {
    return Map.copyOf(statusCodeCounts);
}

하지만 현재 사용 패턴상 필요하지 않으므로, 오버엔지니어링일 수 있습니다.


📝 요약

필수 개선사항:

  1. InterruptedException 처리 개선 (로깅 + 인터럽트 플래그 복원)

권장 개선사항:
2. 패키지 위치 재고려 (global.locksupport)
3. execute() 메서드 Javadoc 추가로 동작 방식 명확화

현재 상태로도 괜찮은 부분:

  • ConcurrencyTestResult의 thread-safety 구현
  • 테스트 환경의 스레드 수 설정 (동시성 제어 검증 목적으로는 적절)

위 사항들 검토하시고, 특히 1번 InterruptedException 처리는 개선하시는 게 좋을 것 같습니다!

@github-actions
Copy link

Overall Project 93.41% 🍏

There is no coverage information present for the Files changed

Copy link
Contributor

@changuii changuii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인해주세요!

Comment on lines 39 to 40
log.error("동시성 테스트 실행 중 예외 발생", e);
result.recordStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 상황은 API 호출 후, 결과로 INTERNAL_SERVER_ERROR인 상황을 제외하고도 다양할 것 같은데 다른 방법으로 기록하는건 어떤가요?

INTERNAL_SERVER_ERROR를 카운팅하는 것보다는 ConcurrencyTestResult에 필드를 추가해서 정상적으로 테스트가 종료된 횟수라던가, 아니면 문제가 발생했던 횟수라던가를 추가해서 확인하는게 더 정확할 것 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

부기! 좋은 인사이트 감사합니다.

네이밍 명칭을 고민하다가 errorCount 라고 지칭했는데, 피드백해줘요!

test: Error Count 및 Cause 추가

Comment on lines 22 to 27
public int getSuccessCount() {
return statusCodeCounts.entrySet().stream()
.filter(entry -> entry.getKey().is2xxSuccessful())
.mapToInt(Map.Entry::getValue)
.sum();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위에 StatusCodeCount를 강제하는게 어때요?

  • 성공하는 경우가, 200번대는 맞겠지만 실제로 200번대 응답이 뒤섞였을 가능성이 여기서는 알 수 없을 것 같아요

예를 들어 성공 예상은 200응답 11개지만, 200 응답 10개, 201응답 1개가 되었을 때 해당 메서드를 사용하면 모를 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

부기 말대로 200번대는 맞지만, 오해의 소지가 있을 수 있다고 생각이 들어요.

그렇다면, 1차적으로는 삭제했지만, 또 다른 생각 방향으로는 is2xxSuccessful 네이밍으로 변경하는 건 어떤가요?

현재는 해당 메서드 삭제했습니다.

@taek2222 taek2222 requested a review from changuii December 31, 2025 13:46
@github-actions
Copy link

Overall Project 93.41% 🍏

There is no coverage information present for the Files changed

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants