일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- mybatis
- BPMN
- Linux
- springboot
- gradle
- nginx
- JavaScript
- VSCode
- LOG4J
- Java
- tibero
- NCP
- log4j2
- useEffect
- nodejs
- gson
- Kubernetes
- JPA
- Windows
- dbeaver
- Spring
- IntelliJ
- docker
- maven
- Git
- sapfiorielements
- database
- MySQL
- intellijIDEA
- react
- Today
- Total
두 손끝의 창조자
junit5 병렬 테스트 실행 본문
resources/junit-platform.properties 파일 만들고
junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.config.strategy=dynamic
junit.jupiter.execution.parallel.mode.default = same_thread
junit.jupiter.execution.parallel.mode.classes.default = same_thread
밑에 config는 스레드 개수를 설정한다. 자신의 상황에 맞춰서 아래 링크를 참조하여 수정
https://junit.org/junit5/docs/snapshot/user-guide/index.html#writing-tests-parallel-execution
JUnit 5 User Guide
Although the JUnit Jupiter programming model and extension model will not support JUnit 4 features such as Rules and Runners natively, it is not expected that source code maintainers will need to update all of their existing tests, test extensions, and cus
junit.org
dynamic은 사용 가능한 프로세서 / 코어 수에 junit.jupiter.execution.parallel.config.dynamic.factor 구성 매개 변수 (기본값 1)를 곱하여 원하는 병렬 처리를 계산 한다.
그리고 수행하고자 하는 테스트 클래스 위에 @Execution(ExecutionMode.CONCURRENT)
라고 붙이면 해당 클래스의 테스트는 병렬로 수행된다. 반대로 같은 스레드에서 동작하게 ExecutionMode 만 바꿔주면 된다.