Skip to content

Commit 737d2fc

Browse files
committed
test: restore Ctrl-C before launching native home fixtures
1 parent be6fb71 commit 737d2fc

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎.agents/docs/2026-10-19-first-run-home-and-network-design.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,3 +676,23 @@ authority 检查;该实验不作为已安装客户端的升级证明,也未
676676

677677
更新 pin 后的 E2E 919、920 及曾失败的 E2E 22 均通过。E2E 22 先检查真正冷 home 的
678678
doctor 不创建 registry,再单独继承工具链验证 std 缓存及发布 dry-run,保留原有断言。
679+
680+
681+
### 12.14 Windows 取消夹具的继承环境
682+
683+
be6fb711 的四平台构建通过,Windows 原生菜单的非法输入和 EOF 均通过,但 Ctrl+C
684+
等待 20 秒后超时。[Windows 的忽略 Ctrl+C 属性](https://learn.microsoft.com/en-us/windows/console/setconsolectrlhandler)由父进程继承;控制器在子进程创建之后
685+
才屏蔽自身中断,不能消除 CI shell 已经传下的忽略属性。
686+
687+
临时观测 PR #823 的 [运行 39214421955](https://github.com/mcpp-community/mcpp/actions/runs/39214421955)
688+
复用 be6fb711 的 Windows 二进制,只在每次创建子进程前让测试控制器取得控制台并恢复
689+
正常 Ctrl+C 处理。全部菜单场景通过:非法输入退出 2、EOF 退出 1、Ctrl+C 退出
690+
3221225786,1/2/空行的目录选择与 reparse 排除也通过;未放宽原有退出及零写入断言。
691+
生产程序不作修改,正式夹具采用相同的启动条件修正。
692+
693+
为优先验证该已失败项,已取消 be6fb711 旧 CI 的剩余作业,不把取消项算作通过。
694+
其已完成证据保留;最终 gate 必须重新运行修正夹具后的完整 head,包括旧 ACP 专项,
695+
不能用临时探针或旧 head 的局部绿色替代。
696+
697+
取消之后的 target-matrix 汇总 job 117935724226 也返回失败:扫描作业被取消,下载结果为
698+
0 个 matrix 产物,未进入目标行为对照。保留此结果,不修改汇总 gate 或减少预期平台。

‎.github/tools/check_windows_home_menu.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ class InputRecord(c.Structure):
5656
kernel.SetConsoleCtrlHandler.restype = w.BOOL
5757
kernel.GenerateConsoleCtrlEvent.argtypes = [w.DWORD, w.DWORD]
5858
kernel.GenerateConsoleCtrlEvent.restype = w.BOOL
59+
kernel.GetConsoleCP.argtypes = []
60+
kernel.GetConsoleCP.restype = w.UINT
61+
kernel.AllocConsole.argtypes = []
62+
kernel.AllocConsole.restype = w.BOOL
5963

6064
def opened(name):
6165
handle = kernel.CreateFileW(name, 0xC0000000, 3, None, 3, 0, None)
@@ -113,6 +117,12 @@ def run_case(name, choice):
113117
env = os.environ.copy()
114118
env.pop('MCPP_HOME', None)
115119
env.update(USERPROFILE=str(profile), HOME=str(profile), MCPP_OFFLINE='1')
120+
# A CI shell can leave its descendants ignoring Ctrl-C. Give this
121+
# native-console fixture an ordinary interactive launch context.
122+
if kernel.GetConsoleCP() == 0 and not kernel.AllocConsole():
123+
raise c.WinError(c.get_last_error())
124+
if not kernel.SetConsoleCtrlHandler(None, False):
125+
raise c.WinError(c.get_last_error())
116126
proc = subprocess.Popen([str(binary), 'self', 'init'], env=env, cwd=root,
117127
creationflags=subprocess.CREATE_NEW_CONSOLE)
118128
output = stdin = None

0 commit comments

Comments
 (0)