Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

ci(windows): isolate native singleton probes from unit workers

DavidShendacdab7ff50a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1804795579..82c4d7f571 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -287,6 +287,10 @@ jobs:
run: pnpm install:ripgrep
# 保留 Windows 路径、进程与锁的自测覆盖。
+ # 原生探测单独运行,避免 PowerShell/CLR 冷启动与 unit worker 争抢资源。
+ - name: Run Windows native process checks
+ run: pnpm run test:workspaces --tier windows-native --workspace desktop
+
- name: Run Windows test runner self-tests
run: pnpm test:runner
diff --git a/scripts/__tests__/dev-docs-contract.test.mjs b/scripts/__tests__/dev-docs-contract.test.mjs
index 6e4af77bee..0458029700 100644
--- a/scripts/__tests__/dev-docs-contract.test.mjs
+++ b/scripts/__tests__/dev-docs-contract.test.mjs
@@ -333,6 +333,9 @@ test("client CI keeps the complete sharded unit gate on Windows", () => {
assert.doesNotMatch(runnerChecks, /^ needs:/m);
assert.doesNotMatch(runnerChecks, /^ strategy:/m);
assert.equal([...runnerChecks.matchAll(/^ run: pnpm test:runner$/gm)].length, 1);
+ // CI #6429: the native mutex probe stays mandatory, on a separate runner from unit shards.
+ assert.match(runnerChecks, /^ - name: Run Windows native process checks\r?\n run: pnpm run test:workspaces --tier windows-native --workspace desktop$/m);
+ assert.doesNotMatch(shards, /--tier windows-native/);
assert.match(runnerChecks, /botCanonicalSession\.test\.ts/);
const gate = workflowJob(workflow, "windows-unit");
diff --git a/scripts/__tests__/test-workspaces.test.mjs b/scripts/__tests__/test-workspaces.test.mjs
index 116bb17b1c..31824c6f73 100644
--- a/scripts/__tests__/test-workspaces.test.mjs
+++ b/scripts/__tests__/test-workspaces.test.mjs
@@ -576,6 +576,26 @@ test("desktop real-Git coverage is an explicit coordinated tier outside default
assert.deepEqual(selectFilesForTier(desktop, tier, files), files.slice(0, 2));
});
+// CI #6429: the real PowerShell/CLR probe exceeded its bounded deadline inside
+// the unit pool. Keep it collected by an exclusive native tier instead (runner).
+test("Windows native barrier coverage runs outside the parallel unit pool", () => {
+ const desktop = manifest.workspaces.find((workspace) => workspace.cwd === "apps/desktop");
+ const files = [
+ "apps/desktop/src/main/__tests__/windowsPackagedInstanceBarrier.test.ts",
+ "apps/desktop/src/main/__tests__/lifecycle.test.ts",
+ ];
+ assert.deepEqual(selectFilesForTier(desktop, desktop.tiers.unit, files), files.slice(1));
+ const tier = desktop.tiers["windows-native"];
+ assert.ok(tier, "the real Windows probe must retain an explicit test tier");
+ assert.equal(tier.status, "manual");
+ assert.equal(tier.execution, "exclusive");
+ assert.equal(tier.coverage, "allowlist");
+ assert.deepEqual(selectFilesForTier(desktop, tier, files), files.slice(0, 1));
+ assert.deepEqual(tier.command, {
+ type: "packageBin", bin: "vitest", args: ["run", "--pool=forks", "--maxWorkers=1"],
+ });
+});
+
test("maker-core real-Git worktree matrix is an explicit tier outside default unit", () => {
const makerCore = manifest.workspaces.find(
(workspace) => workspace.cwd === "packages/maker-core",
diff --git a/scripts/test-workspaces.config.mjs b/scripts/test-workspaces.config.mjs
index b989d0d9bc..b66b265dc7 100644
--- a/scripts/test-workspaces.config.mjs
+++ b/scripts/test-workspaces.config.mjs
@@ -84,6 +84,9 @@ const desktopDbExclude = [
const desktopGitIntegrationInclude = [
'src/main/**/*.git-integration.test.ts',
];
+const desktopWindowsNativeInclude = [
+ 'src/main/__tests__/windowsPackagedInstanceBarrier.test.ts',
+];
const makerCoreIntegrationInclude = [
'src/agents/codex/*.integration.test.ts',
'src/agents/claude-code/__tests__/*.integration.test.ts',
@@ -348,6 +351,7 @@ export default {
'**/*.git-integration.test.ts',
'**/*.integration.test.ts',
'**/*.e2e.test.ts',
+ ...desktopWindowsNativeInclude,
'src/main/localDb/**',
'src/main/__tests__/*Migration.test.ts',
'src/main/__tests__/schemaDriftRepair.test.ts',
@@ -370,6 +374,14 @@ export default {
command: vitestBin('run', `--maxWorkers=${desktopUnitWorkerCount()}`),
include: desktopGitIntegrationInclude,
},
+ 'windows-native': {
+ status: 'manual',
+ reason: 'Real PowerShell/CLR and named-mutex probes run separately from unit workers; Windows CI requires this tier.',
+ execution: 'exclusive',
+ coverage: 'allowlist',
+ command: vitestBin('run', '--pool=forks', '--maxWorkers=1'),
+ include: desktopWindowsNativeInclude,
+ },
e2e: {
status: 'manual',
reason: 'Desktop E2E tests spawn the real Codex binary and are explicit because they are platform and binary dependent.',