fix: resolve 6 test failures — timeouts and window_list syntax
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 2s
Generic: Repo Health / Access control (push) Successful in 1s
Universal: Changelog Validation / Validate CHANGELOG.md (push) Failing after 3s
MCP: Standards Compliance / Secret Scanning (push) Successful in 3s
MCP: Standards Compliance / License Header Validation (push) Failing after 4s
MCP: Build & Validate / build (20) (push) Failing after 8s
MCP: Build & Validate / build (22) (push) Failing after 9s
MCP: Standards Compliance / Repository Structure Validation (push) Failing after 4s
MCP: Standards Compliance / Coding Standards Check (push) Failing after 4s
MCP: Standards Compliance / Workflow Configuration Check (push) Failing after 3s
Universal: Build & Release / Build & Release Pipeline (push) Failing after 14s
MCP: Standards Compliance / Documentation Quality Check (push) Successful in 4s
MCP: Standards Compliance / README Completeness Check (push) Failing after 3s
MCP: Standards Compliance / Git Repository Hygiene (push) Successful in 3s
MCP: Standards Compliance / File Naming Standards (push) Successful in 4s
MCP: Standards Compliance / Insecure Code Pattern Detection (push) Successful in 4s
MCP: Standards Compliance / Line Length Check (push) Failing after 5s
MCP: Standards Compliance / Script Integrity Validation (push) Successful in 7s
MCP: Standards Compliance / File Size Limits (push) Successful in 6s
MCP: Standards Compliance / Dead Code Detection (push) Successful in 7s
MCP: Standards Compliance / Binary File Detection (push) Successful in 6s
MCP: Standards Compliance / TODO/FIXME Tracking (push) Successful in 5s
MCP: Build & Release / Build, Validate & Release (push) Failing after 36s
MCP: Standards Compliance / Broken Link Detection (push) Successful in 7s
MCP: Standards Compliance / API Documentation Coverage (push) Successful in 5s
MCP: Standards Compliance / Accessibility Check (push) Successful in 3s
MCP: Standards Compliance / Performance Metrics (push) Successful in 4s
MCP: Standards Compliance / Version Consistency Check (push) Successful in 49s
Universal: CodeQL Analysis / Analyze (actions) (push) Failing after 1m10s
MCP: Standards Compliance / Code Duplication Detection (push) Successful in 51s
MCP: Standards Compliance / Code Complexity Analysis (push) Successful in 52s
MCP: Standards Compliance / Unused Dependencies Check (push) Successful in 44s
MCP: Standards Compliance / Terraform Configuration Validation (push) Successful in 15s
MCP: Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 49s
Universal: CodeQL Analysis / Analyze (javascript) (push) Failing after 1m22s
Universal: CodeQL Analysis / Security Scan Summary (push) Successful in 2s
MCP: Standards Compliance / Enterprise Readiness Check (push) Successful in 44s
MCP: Standards Compliance / Repository Health Check (push) Successful in 44s
MCP: Standards Compliance / Compliance Summary (push) Failing after 1s
Universal: Sync Version on Merge / Propagate README version (push) Failing after 46s
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 2s
Generic: Repo Health / Access control (push) Successful in 1s
Universal: Changelog Validation / Validate CHANGELOG.md (push) Failing after 3s
MCP: Standards Compliance / Secret Scanning (push) Successful in 3s
MCP: Standards Compliance / License Header Validation (push) Failing after 4s
MCP: Build & Validate / build (20) (push) Failing after 8s
MCP: Build & Validate / build (22) (push) Failing after 9s
MCP: Standards Compliance / Repository Structure Validation (push) Failing after 4s
MCP: Standards Compliance / Coding Standards Check (push) Failing after 4s
MCP: Standards Compliance / Workflow Configuration Check (push) Failing after 3s
Universal: Build & Release / Build & Release Pipeline (push) Failing after 14s
MCP: Standards Compliance / Documentation Quality Check (push) Successful in 4s
MCP: Standards Compliance / README Completeness Check (push) Failing after 3s
MCP: Standards Compliance / Git Repository Hygiene (push) Successful in 3s
MCP: Standards Compliance / File Naming Standards (push) Successful in 4s
MCP: Standards Compliance / Insecure Code Pattern Detection (push) Successful in 4s
MCP: Standards Compliance / Line Length Check (push) Failing after 5s
MCP: Standards Compliance / Script Integrity Validation (push) Successful in 7s
MCP: Standards Compliance / File Size Limits (push) Successful in 6s
MCP: Standards Compliance / Dead Code Detection (push) Successful in 7s
MCP: Standards Compliance / Binary File Detection (push) Successful in 6s
MCP: Standards Compliance / TODO/FIXME Tracking (push) Successful in 5s
MCP: Build & Release / Build, Validate & Release (push) Failing after 36s
MCP: Standards Compliance / Broken Link Detection (push) Successful in 7s
MCP: Standards Compliance / API Documentation Coverage (push) Successful in 5s
MCP: Standards Compliance / Accessibility Check (push) Successful in 3s
MCP: Standards Compliance / Performance Metrics (push) Successful in 4s
MCP: Standards Compliance / Version Consistency Check (push) Successful in 49s
Universal: CodeQL Analysis / Analyze (actions) (push) Failing after 1m10s
MCP: Standards Compliance / Code Duplication Detection (push) Successful in 51s
MCP: Standards Compliance / Code Complexity Analysis (push) Successful in 52s
MCP: Standards Compliance / Unused Dependencies Check (push) Successful in 44s
MCP: Standards Compliance / Terraform Configuration Validation (push) Successful in 15s
MCP: Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 49s
Universal: CodeQL Analysis / Analyze (javascript) (push) Failing after 1m22s
Universal: CodeQL Analysis / Security Scan Summary (push) Successful in 2s
MCP: Standards Compliance / Enterprise Readiness Check (push) Successful in 44s
MCP: Standards Compliance / Repository Health Check (push) Successful in 44s
MCP: Standards Compliance / Compliance Summary (push) Failing after 1s
Universal: Sync Version on Merge / Propagate README version (push) Failing after 46s
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
- audio.ts: increase Add-Type C# compilation timeout to 60s - system.ts: increase WMI query timeout to 45s - service.ts: batch WMI lookups (single query instead of per-service), 45s timeout - power.ts: increase powercfg timeout to 30s - window.ts: fix .Where() syntax to pipe-based Where-Object - shell.ts: unref terminal session child processes so MCP server can exit cleanly Test results: 36/36 passed (12 skipped — destructive/interactive) Authored-by: Moko Consulting
This commit is contained in:
@@ -182,7 +182,13 @@ export function startSession(shell: 'pwsh' | 'cmd' | 'bash' | 'python' | 'node'
|
||||
const proc = spawn(executable, args, {
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
windowsHide: true,
|
||||
detached: false,
|
||||
});
|
||||
// Don't let terminal sessions prevent the MCP server from exiting
|
||||
proc.unref();
|
||||
(proc.stdout as any)?.unref?.();
|
||||
(proc.stderr as any)?.unref?.();
|
||||
(proc.stdin as any)?.unref?.();
|
||||
|
||||
const session: TerminalSession = {
|
||||
pid: proc.pid!,
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ $device = (Get-CimInstance Win32_SoundDevice | Where-Object { $_.Status -eq 'OK'
|
||||
device = $device
|
||||
} | ConvertTo-Json -Compress`;
|
||||
|
||||
const result = await runPowerShell(ps);
|
||||
const result = await runPowerShell(ps, { timeout: 60000 });
|
||||
if (result.exitCode !== 0) {
|
||||
return { content: [{ type: 'text', text: `Error: ${result.stderr}` }], isError: true };
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ $dcSleep = (powercfg /query SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 2>$null | Selec
|
||||
SleepTimeout_DC = if ($dcSleep) { "$([math]::Floor($dcSleep / 60))m" } else { 'Never' }
|
||||
} | ConvertTo-Json -Compress`;
|
||||
|
||||
const result = await runPowerShell(ps, { timeout: 10000 });
|
||||
const result = await runPowerShell(ps, { timeout: 30000 });
|
||||
if (result.exitCode !== 0) {
|
||||
return { content: [{ type: 'text', text: `Error: ${result.stderr}` }], isError: true };
|
||||
}
|
||||
@@ -113,7 +113,7 @@ $dcSleep = (powercfg /query SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 2>$null | Selec
|
||||
break;
|
||||
}
|
||||
|
||||
const result = await runPowerShell(ps, { timeout: 10000 });
|
||||
const result = await runPowerShell(ps, { timeout: 30000 });
|
||||
return {
|
||||
content: [{ type: 'text', text: result.stdout || result.stderr }],
|
||||
isError: result.exitCode !== 0,
|
||||
|
||||
@@ -27,18 +27,19 @@ export function registerServiceTools(server: McpServer): void {
|
||||
: '';
|
||||
|
||||
const ps = `
|
||||
$wmiCache = @{}
|
||||
Get-CimInstance Win32_Service -ErrorAction SilentlyContinue | ForEach-Object { $wmiCache[$_.Name] = $_.Description }
|
||||
Get-Service ${filterClause} ${statusClause} | Sort-Object DisplayName | ForEach-Object {
|
||||
$wmi = Get-CimInstance Win32_Service -Filter "Name='$($_.Name)'" -ErrorAction SilentlyContinue
|
||||
[PSCustomObject]@{
|
||||
Name = $_.Name
|
||||
DisplayName = $_.DisplayName
|
||||
Status = $_.Status.ToString()
|
||||
StartType = $_.StartType.ToString()
|
||||
Description = if ($wmi) { $wmi.Description } else { '' }
|
||||
Description = if ($wmiCache[$_.Name]) { $wmiCache[$_.Name] } else { '' }
|
||||
}
|
||||
} | ConvertTo-Json -Depth 3 -Compress`;
|
||||
|
||||
const result = await runPowerShell(ps, { timeout: 20000 });
|
||||
const result = await runPowerShell(ps, { timeout: 45000 });
|
||||
if (result.exitCode !== 0) {
|
||||
return { content: [{ type: 'text', text: `Error: ${result.stderr}` }], isError: true };
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ $uptime = (Get-Date) - $os.LastBootUpTime
|
||||
Uptime = "$($uptime.Days)d $($uptime.Hours)h $($uptime.Minutes)m"
|
||||
} | ConvertTo-Json -Depth 4 -Compress`;
|
||||
|
||||
const result = await runPowerShell(ps, { timeout: 15000 });
|
||||
const result = await runPowerShell(ps, { timeout: 45000 });
|
||||
if (result.exitCode !== 0) {
|
||||
return { content: [{ type: 'text', text: `Error: ${result.stderr}` }], isError: true };
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ export function registerWindowTools(server: McpServer): void {
|
||||
},
|
||||
async ({ filter }) => {
|
||||
const filterClause = filter
|
||||
? `.Where({ $_.Title -like '*${filter.replace(/'/g, "''")}*' })`
|
||||
? `| Where-Object { $_.Title -like '*${filter.replace(/'/g, "''")}*' }`
|
||||
: '';
|
||||
|
||||
const ps = `
|
||||
|
||||
Reference in New Issue
Block a user