fix: add timeout protection to PowerShell Pester test runner - #406
Merged
Merged
Conversation
boyingliu01
had a problem deploying
to
development
August 26, 2026 05:45 — with
GitHub Actions
Failure
XP-Gate Quality ReportQuality Gate Status: failure Quality checks have completed for this pull request. |
boyingliu01
force-pushed
the
fix/powershell-test-timeout
branch
from
August 27, 2026 04:50
14a6a29 to
4e90967
Compare
boyingliu01
had a problem deploying
to
development
August 27, 2026 04:51 — with
GitHub Actions
Failure
XP-Gate Quality ReportQuality Gate Status: failure Quality checks have completed for this pull request. |
boyingliu01
force-pushed
the
fix/powershell-test-timeout
branch
from
August 27, 2026 05:23
4e90967 to
b69feb2
Compare
XP-Gate Quality ReportQuality Gate Status: success Quality checks have completed for this pull request. ✅ All quality gates have passed. Ready for review! |
PowerShell adapter's run_tests/run_coverage invoked Invoke-Pester with no timeout. A hanging Pester test (e.g. a test that dot-sources a script whose body performs WMI/registry/scheduled-task scans) would block 'git commit' forever. Wrap Invoke-Pester in GNU timeout (default 300s, override via XP_GATE_POWERSHELL_TEST_TIMEOUT_S). On timeout, print a clear warning and return non-zero instead of hanging indefinitely. Fixes #405. Also bumps VERSION to 0.18.5.1 and syncs package.json (resolves pre-existing VERSION/package.json drift).
boyingliu01
force-pushed
the
fix/powershell-test-timeout
branch
from
August 27, 2026 06:11
b69feb2 to
4e8c01e
Compare
XP-Gate Quality ReportQuality Gate Status: success Quality checks have completed for this pull request. ✅ All quality gates have passed. Ready for review! |
boyingliu01
pushed a commit
that referenced
this pull request
Aug 30, 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.
变更说明
修复 PowerShell 适配器
run_tests/run_coverage调用Invoke-Pester无超时保护的问题。挂起的 Pester 测试会无限阻塞git commit。问题背景
githooks/adapters/powershell.sh的run_tests直接调用Invoke-Pester,无任何超时。若某个测试点源(dot-source)了脚本、脚本体执行 WMI/注册表/计划任务扫描(如Get-CimInstance Win32_Service、Get-ScheduledTask),该测试挂起,Invoke-Pester永不返回 →git commit无限阻塞。修复
用 GNU
timeout(默认 300s,可用XP_GATE_POWERSHELL_TEST_TIMEOUT_S覆盖)包裹Invoke-Pester。超时后打印清晰警告并返回非零退出码,而非永久挂起。验证
$@完整转发相关