WIP 시험 흔들림 (10/21 전체 실행): ① 가짜 DNS - OS 가 TCP 번호를 차례로 주는데 그 둘레가 통째로 UDP 막힌 범위 (10013) 라 50번 모두 실패 → 홀수 번째는 UDP 를 먼저 OS 가 고른 번호로 열고 그 번호로 TCP ② QueuedHwpDoc "제 시작부터 잰다" - 뒤 묶음 제한 300ms 가 무거울 때 놓아주기까지의 틈보다 짧았다 → 제한 1.5초 · 줄에서 2초 기다림 (뜻은 같음) · 3번 반복 통과 (검토 대기)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xplore_view
RyuJongJin 2026-10-21 01:45:27 +09:00
parent 77710c2a5f
commit 189e51b45e
2 changed files with 27 additions and 11 deletions

View File

@ -231,8 +231,9 @@ void main() {
final n = _Gated();
final d = QueuedHwpDoc(n);
final a = d.exportPdf(0, 5, 'a', timeout: const Duration(seconds: 30)); // 오래 도는 앞 묶음
final b = d.exportPdf(5, 10, 'b', timeout: const Duration(milliseconds: 300));
await Future<void>.delayed(const Duration(milliseconds: 700)); // 뒤 묶음의 제한보다 오래 줄에서 기다림
// 흔들림 (10/21 전체 실행): 제한이 300ms 면 무거울 때 [release] 까지의 틈이 그것을 넘었다 - 제한 1.5초 · 줄에서 2초 기다림
final b = d.exportPdf(5, 10, 'b', timeout: const Duration(milliseconds: 1500));
await Future<void>.delayed(const Duration(milliseconds: 2000)); // 뒤 묶음의 제한보다 오래 줄에서 기다림
expect(n.started, [1]);
n.release(1);
await a;

View File

@ -46,6 +46,20 @@ class FakeDns {
// netsh int ipv4 show excludedportrange) 가 달라, TCP 를 먼저 OS 가 고른 번호로 열고 그 번호로 UDP 를 연다.
// 그 번호의 UDP 가 막혀 있거나 (10013) 쓰는 중이면 다른 번호로 다시
for (var i = 0;; i++) {
// 10/21 전체 실행: OS 가 TCP 번호를 차례로 주는데 (62345, 62346 …) 그 둘레가 통째로 UDP 막힌 범위라 50번 모두 실패했다 -
// 홀수 번째는 거꾸로 UDP 를 OS 가 고른 (열 수 있는) 번호로 먼저 열고 그 번호로 TCP 를 연다
if (i.isOdd) {
final udp = await RawDatagramSocket.bind(InternetAddress.loopbackIPv4, 0);
try {
_tcp = await ServerSocket.bind(InternetAddress.loopbackIPv4, udp.port);
_udp = udp;
events.add('bound udp+tcp ${udp.port} (try $i)');
break;
} on SocketException catch (e) {
events.add('tcp bind ${udp.port} failed: ${e.osError?.errorCode} ${e.message}');
udp.close();
}
} else {
final tcp = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
final udp = await _tryUdp(tcp.port);
if (udp != null) {
@ -55,7 +69,8 @@ class FakeDns {
break;
}
await tcp.close();
if (i > 50) throw StateError('UDP 포트를 열지 못함: $events');
}
if (i > 50) throw StateError('UDP · TCP 같은 포트를 열지 못함: $events');
}
}
_udp.listen((e) {