Repository navigation
Conversation
逐条计时后,八成以上时间在三个 UI 测试类里空等真实时间,按原因分别处理: - HeadlessPump 每拍保证的时间从 5 ms 降到 2 ms(固定等待原占 UI 用例约六成时间); 新增 VELASHELL_TEST_PUMP_SCALE 环境变量,慢机器上偶发失败时整体放大,不必改代码 - 两条依赖 @ 补全 180 ms 防抖的用例改为等弹层真弹出来再断言;断言「不弹」的那处保留 300 ms 真实等待 - ProviderSetupView 新增 DevicePollDelay 测试替身:假授权端点的 1 秒轮询间隔缩成 20 ms(约省 55 秒) - ChatPanelView 新增 RetryDelayOverride 测试替身:补试 / 故障转移的 400 / 800 ms 退避按 1/20 等(约省 45 秒) - HealthProbe 新增 ProbeWithTimeoutAsync:截止时间用例按比例从 15 秒缩到 3 秒(省 12 秒) 生产路径行为不变:三个替身都是 internal,不设时走原来的 Task.Delay 与 15 秒时限。
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
主要改动
VelaShell.Plugin.Ai.Tests整套从 9 分 22 秒降到 5 分 15 秒(2468 条全部通过)。逐条计时后,八成以上时间在三个 UI 测试类里空等真实时间,按原因分别处理:HeadlessPump每拍至少等 5 ms(共 1859 次调用)VELASHELL_TEST_PUMP_SCALE环境变量,慢机器上整体放大"interval":1,每次登录真等 1 秒ProviderSetupView.DevicePollDelay测试替身,1 秒缩成 20 ms(更长的刻意挂起间隔照原样等)ChatPanelView.RetryDelayOverride测试替身,UI 用例按 1/20 等HealthProbe.ProbeWithTimeoutAsync,用例按比例缩到 3 秒各类耗时:聊天面板 274→161 秒,供应商设置 127→44 秒,模型设置 79→48 秒,探活 24→12 秒。
另外两条依赖
@补全 180 ms 防抖的用例改为等弹层真弹出来再断言;断言「不弹出」的那处无条件可等,保留 300 ms 真实等待,避免空过。生产路径行为不变:三个替身都是
internal,不设时仍走原来的Task.Delay与 15 秒时限。风险
固定等待缩短后,慢机器(尤其 macOS CI)上可能出现偶发失败。实测每拍降到 1.5 ms 时只有上面两条防抖用例失败(已改为等条件),2 ms 在此之上多留了余量。若 CI 出现偶发失败,设
VELASHELL_TEST_PUMP_SCALE=2.5即回到原来的 5 ms。验证
dotnet build tests/VelaShell.Plugin.Ai.Tests:通过,无警告dotnet test tests/VelaShell.Plugin.Ai.Tests:2468 通过 / 0 失败 / 0 跳过,5 分 15 秒(本机 Windows,只完整跑过一遍)文档
不涉及文档修改(仅测试与
internal测试替身,无用户可见行为、接口或配置项变化)。