跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

windows_admission_test.go

28 行 · 677 B历史下载
1package workbench
2
3import (
4 "testing"
5 "time"
6)
7
8func TestWindowsAdmissionJoinsStartedTimeout(t *testing.T) {
9 started, release, finished := make(chan struct{}), make(chan struct{}), make(chan struct{})
10 timer := time.AfterFunc(0, func() { close(started); <-release; close(finished) })
11 <-started
12 result := make(chan bool)
13 go func() { result <- cancelWindowsAdmissionDeadline(timer, finished) }()
14 select {
15 case <-result:
16 t.Fatal("admission returned while late timeout could still kill relay")
17 default:
18 }
19 close(release)
20 if <-result {
21 t.Fatal("expired connection was published")
22 }
23 select {
24 case <-finished:
25 default:
26 t.Fatal("timeout callback not joined")
27 }
28}