Skip to content

Commit 80309cd

Browse files
committed
test(bridge): 加 push pipe 回归测试 (8 个), 覆盖已修复的 IPC 关键 bug
用 winio.DialPipe 当假 client + 真实 winio.ListenPipe 服务端, 端到端跑 overlapped pipe 协议栈, 覆盖 mock 测试抓不到的 OS 内核语义. 测试列表: 单元 (pushClient 行为): - TestPushClient_EnqueueBroadcastDropsWhenFull: 队列满 drop 语义 - TestPushClient_ShutdownIdempotent: closeOnce 保护 端到端 (winio 真实 pipe): - TestPushPipe_E2E_TokenHandshake: 基本握手 + SERVICE_READY 时序 - TestPushPipe_E2E_ReaderDoesNotBlockWriter: **核心回归** — 防止有人未来又把 push pipe 改回 sync I/O 触发同 handle Read/Write 串行化 死锁; 200ms 内必须送达, 否则失败信息直接指出 "check FILE_FLAG_OVERLAPPED" - TestPushPipe_E2E_DeadClientCleanedUp: phase-2 reader EOF 检测 + 1s 内 从 pushClients map 移除 - TestPushPipe_E2E_StaleTokenReplaced: 同 token 重连旧 handle 主动清理 (explorer.exe 多实例下避免幽灵 client 累积) - TestPushPipe_E2E_QueueFullDropsLatest: slow client (不读) 触发 outbound 满 drop; 验证 dropCount > 0 - TestPushPipe_E2E_ConcurrentWritesSerialized: 多 goroutine 并发 enqueue + pushClient.mu 串行写 conn 不乱序 每个测试用唯一 pipe 名 (`uniqueSuffix(t)`), 避免并发 / 重跑碰撞. Windows-only (`//go:build windows`). 实测 (race 模式): - 8 个测试全部 PASS, 总耗时 4.3s - go test -race 不报数据竞争
1 parent ab2cf3b commit 80309cd

1 file changed

Lines changed: 462 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)