Skip to content

Commit 10af0a4

Browse files
fix: shorten integration tests and suppress build warnings
- Reduce integration test to max 3min or 30 events (was 10min) - Exclude @tag("integration") from default test task - Suppress javadoc warnings with -Xdoclint:none - Suppress -Xlint:preview compilation notes
1 parent a2495ce commit 10af0a4

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

lib/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,20 @@ publishing {
5252
tasks.withType(Javadoc) {
5353
options.addBooleanOption('-enable-preview', true)
5454
options.addStringOption('source', '25')
55+
options.addStringOption('Xdoclint:none', '-quiet')
5556
}
5657

5758
tasks.withType(JavaCompile) {
5859
options.encoding = 'UTF-8'
59-
options.compilerArgs.addAll(['--enable-preview'])
60+
options.compilerArgs.addAll(['--enable-preview', '-Xlint:-preview'])
6061
dependsOn 'spotlessApply'
6162
}
63+
6264
test {
6365
jvmArgs(['--enable-preview'])
64-
useJUnitPlatform()
66+
useJUnitPlatform {
67+
excludeTags 'integration'
68+
}
6569
testLogging {
6670
showStandardStreams = true
6771
events "passed", "skipped", "failed", "standardOut", "standardError"

lib/src/test/java/com/github/getcurrentthread/soopapi/client/SOOPChatClientRealConnectionTest.java

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class SOOPChatClientRealConnectionTest {
4545
static final String BROAD_LIST_URL =
4646
"https://static.file.sooplive.co.kr/pc/ko_KR/main_broad_list_with_adult_json.js";
4747
static final int TOP_N = 10;
48-
static final int TEST_DURATION_MINUTES = 10;
48+
static final int TEST_DURATION_MINUTES = 3;
49+
static final int MAX_TOTAL_EVENTS = 30;
4950
static final String LOG_DIR = "test-logs";
5051

5152
static final Logger logger = Logger.getLogger(SOOPChatClientRealConnectionTest.class.getName());
@@ -190,19 +191,29 @@ void testTop10RealConnection() throws Exception {
190191

191192
assertTrue(connectedCount.get() >= 5, "최소 5개 이상 연결 필요, 실제: " + connectedCount.get());
192193

193-
// === 4단계: 10분 대기 (1분마다 상태 로그) ===
194-
logger.info("=== " + TEST_DURATION_MINUTES + "분 모니터링 시작 ===");
194+
// === 4단계: 최대 3분 또는 30개 이벤트까지 대기 (10초마다 상태 확인) ===
195+
logger.info(
196+
"=== 모니터링 시작 (최대 "
197+
+ TEST_DURATION_MINUTES
198+
+ "분, "
199+
+ MAX_TOTAL_EVENTS
200+
+ "개 이벤트) ===");
195201

196-
for (int minute = 1; minute <= TEST_DURATION_MINUTES; minute++) {
197-
Thread.sleep(60_000);
202+
long deadline = System.currentTimeMillis() + TEST_DURATION_MINUTES * 60_000L;
203+
int logIntervalSec = 0;
204+
while (System.currentTimeMillis() < deadline && totalEvents.get() < MAX_TOTAL_EVENTS) {
205+
Thread.sleep(10_000);
206+
logIntervalSec += 10;
198207

199208
long activeClients = clients.stream().filter(SOOPChatClient::isConnected).count();
200209
logger.info(
201210
String.format(
202-
"=== [%d분 경과] 연결 클라이언트: %d, 총 수신 이벤트: %d ===",
203-
minute, activeClients, totalEvents.get()));
211+
"=== [%d초 경과] 연결 클라이언트: %d, 총 수신 이벤트: %d ===",
212+
logIntervalSec, activeClients, totalEvents.get()));
204213
}
205214

215+
logger.info("모니터링 종료 - 총 수신 이벤트: " + totalEvents.get());
216+
206217
// === 5단계: 정리 & 통계 ===
207218
logger.info("=== 최종 통계 ===");
208219
for (String bid : bids) {

0 commit comments

Comments
 (0)