Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); fix(test): isolate Windows background terminal tests by yxr-2025 · Pull Request #310 · openpi-dev/openpi · GitHub
Skip to content

fix(test): isolate Windows background terminal tests - #310

Open
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation
Open

fix(test): isolate Windows background terminal tests#310
yxr-2025 wants to merge 3 commits into
openpi-dev:mainfrom
yxr-2025:fix/windows-test-isolation

Conversation

@yxr-2025

@yxr-2025yxr-2025 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Maintainer status (2026-08-31): Not ready to merge. The newly exercised Windows full-suite entry point failed; details and exact-head CI evidence are recorded below.

Problem

Fixes#304.

scripts/run-tests.mjs discovers every Node test file and currently passes the complete list to one node --test invocation. Node runs test files concurrently by default. The background-terminals suite is different from ordinary unit tests: on Windows it creates real process trees, invokes and awaits taskkill, observes settlement callbacks, polls descendant liveness, and cleans up OS resources.

When those tests overlap unrelated Node test files, Windows scheduling and process-tree teardown become timing-sensitive. The result is intermittent failures in the same roughly 3.3-3.8 second teardown window, even though the affected tests are stable alone or when the directory is run serially.

Value

This restores a reliable meaning to the full test result on Windows:

  • CI failures from process-lifecycle timing no longer block unrelated changes.
  • Contributors can trust a red result as evidence of a real regression instead of retrying noisy flakes.
  • Debugging stays focused on production behavior rather than suite-level scheduling.
  • Windows contributors get deterministic local feedback, and prepublishOnly no longer depends on retrying a flaky full suite.
  • The rest of the Node suite retains file-level parallelism, so the reliability fix does not serialize ordinary tests.

Approach

The runner now partitions discovered Node tests with a small platform-aware helper.

  • On Windows, all files under tests/extensions/background-terminals run in a separate node --test --test-concurrency=1 invocation.
  • The remaining Node test files still run in the existing default-concurrency invocation.
  • On non-Windows platforms, the original single parallel Node invocation is unchanged.
  • The entire background-terminal directory is isolated so future real-process tests in that ownership boundary cannot accidentally overlap unrelated files.
  • Production process cleanup, termination boundaries, and behavior assertions are untouched.

The branch has now been rebased onto main@b02ed884 (which includes the separately merged LF policy from #302). LF policy changes are not part of this PR's diff.

Original author validation (before maintainer rebase)

  • bun run check passes: config contract, discipline ledger, format, lint, and typecheck.
  • node --test --experimental-strip-types tests/scripts/node-test-groups.test.ts passes (2/2).
  • Windows strategy simulation partitions 119 Node tests into 111 parallel files and 8 serial background-terminal files, with no serial files outside that directory.
  • The affected background-terminal process tests pass when run without cross-file concurrency.
  • bun run test in this Windows checkout is still blocked by pre-existing path-separator assertions (tests expecting / while Node returns \\), unrelated to this runner change.

Impact

  • User-visible behavior: none.
  • Model-visible tools/context: none.
  • Runtime and persisted data: none.
  • Test infrastructure: Windows-only scheduling change for the background-terminal directory; non-Windows behavior and ordinary test parallelism remain unchanged.
  • Compatibility risk: limited to a longer Windows test phase for this directory; it removes cross-file process contention while preserving parallel speed elsewhere.

Maintainer verification — 2026-08-31

Current head: 0837bff87ea81ffc2c97bb8e3281d4e65a156d25; base: main@b02ed884d8f38f4e05cb55b933eca19b59ead124.

  • 原分组实现保持不变。只在现有 Windows CI 的 manager 测试之后新增 bun run test 验证步骤(5 分钟执行上限),真实经过本 PR 修改的入口;不跳过、不重试、不使用 continue-on-error。
  • 本地 macOS / Node 24.18.0 / Bun 1.3.14:bun install --frozen-lockfilebun run checkbun run test 通过;Node 1088 passed / 1 platform skip / 0 failed;Vitest 30 passed。
  • Standards 和 Spec 独立复核没有新增代码问题。
  • Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。
    • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
    • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
    • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

@tt-a1i
tt-a1iforce-pushed the fix/windows-test-isolation branch from d071569 to 0837bffCompareAugust 31, 2026 13:33
@tt-a1i
tt-a1i requested review from a team and tt-a1i as code ownersAugust 31, 2026 13:33
@github-actionsgithub-actionsBot added the area:github GitHub workflows, templates, ownership, or tests label Aug 31, 2026
@tt-a1i

Copy link
Copy Markdown
Collaborator

推进结果(head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25):已同步 main@b02ed884,保留原分组代码,仅新增真实 Windows 全量入口验证。

Windows 实跑已完成,当前不能合并:CI run 33397613622。Node 22 / Node 24 CI 通过;Windows 原有 manager 生命周期步骤通过,但新增完整入口步骤失败并在 5 分钟上限处超时。

  • 已确认断言失败:tests/extensions/file-mutation-display/render.test.ts:236(read fixture 正则位于第 68 行附近)只接受 src/long-file.ts,Windows 实际输出 src\\long-file.ts:10-29。该文件及相关生产渲染实现与 base main 完全相同,不属于本 PR 的分组改动。
  • 普通 Node 组未正常结束,串行 background-terminals 组及 Vitest 没有进入;日志不足以确定挂起根因,不能把超时直接归因于上述路径断言,也不能宣称 flaky 已消除。
  • 未放宽断言、未跳过测试、未加重试、未绕过红灯。后续需要定位 Windows 全量挂起并处理既有测试兼容性;此轮保持 PR OPEN,暂停合并。

本地 check/test:1088 Node passed / 1 platform skip,30 Vitest passed。Standards / Spec 对本次 CI 接线未发现新增代码问题;这不替代失败的 Windows 验收。

@tt-a1itt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: changes requested — Windows acceptance remains blocked

Reviewed exact head 0837bff87ea81ffc2c97bb8e3281d4e65a156d25.

Problem / value / approach

Serializing the Windows background-terminal test group addresses contention while preserving normal parallel execution elsewhere. The partitioning approach is appropriately small; no new production-code defect was found in that change.

Merge blocker: the actual Windows full-suite entry point is not passing

Run 33397613622, Windows job passed the original manager lifecycle step, but the newly added bun run test step failed and reached its five-minute timeout. The ordinary Node group did not finish, so the serial background group and Vitest were not reached. Please do not treat the manager-only pass or Linux passes as full Windows acceptance.

The subsequent diagnosis identifies existing test-fixture problems, not regressions introduced by the contributor's grouping change:

  1. Confirmed native Windows failure:file-mutation-display/render.test.ts:68 expects src/long-file.ts, while the native Windows output is src\\long-file.ts. The success-row test fails on this assertion.
  2. High-confidence explanation for the subsequent stall:git-info/index.test.ts creates extensionless Unix shell stubs, joins PATH with : at line 62, and waits without a deadline for an isRepository: true event at line 113. Windows uses ; for PATH and cannot use these fixtures as ordinary native executables. If the fake git is not executed, the real refresh can publish isRepository: false; that never resolves this promise, and cleanup is behind the await.
    • Three local paired fault-injection runs: the valid stub passed 3/3; removing the stub from PATH published isRepository: false and hit a diagnostic two-second deadline 3/3. Cleanup completed once the deadline released the await.
    • These were macOS fault-injection runs, not native Windows isolated-test passes. They explain a reproducible failure path consistent with the CI stall; the exact Windows hang still needs confirmation by a native rerun.
  3. Static follow-up: tests/test-discovery.test.ts also contains slash-specific path checks. This was identified by inspection, not reported as an observed failure in that timed-out Windows run.

These relevant fixtures are unchanged from base b02ed884d8f38f4e05cb55b933eca19b59ead124.

Smallest follow-up

Use cross-platform command fixtures and path expectations, and give the expected-event wait a bounded failure with cleanup. Then rerun the native Windows full test entry point through both Node groups and Vitest. No production lifecycle rewrite, retries, or simply increasing the CI timeout is warranted by the current evidence. The follow-up can be isolated if preferred, but this PR should not be merged with its required Windows check failing.

Verification boundaries

  • Exact-head local bun run check: passed.
  • Exact-head local bun run test: Node 1088 passed / 1 skipped; Vitest 30 passed.
  • Linux Node 22/24 CI: passed.
  • Native Windows full-suite CI: failed / timed out.
  • This review does not claim Windows acceptance, merge, or release.

@tt-a1i

Copy link
Copy Markdown
Collaborator

Review 已提交:Changes requested,固定 head 0837bff。分组方案未发现新增生产代码缺陷;阻挡项是新增的 Windows 全量 CI 未通过。已把路径断言的原生失败、git-info 测试夹具导致无限等待的本地对照证据,以及仍需 Windows 复跑的限制分别写清。建议只修跨平台测试夹具、路径断言和有界等待,不扩大生产代码改动;本轮未再改代码、未合并。

@yxr-2025
yxr-2025force-pushed the fix/windows-test-isolation branch from 0837bff to 44de99fCompareSeptember 1, 2026 16:42
@github-actionsgithub-actionsBot added the area:ui Terminal UI, rendering, themes, or visual assets label Sep 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:githubGitHub workflows, templates, ownership, or testsarea:uiTerminal UI, rendering, themes, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: eliminate Windows background-terminal process-test flakes in the full suite

2 participants

@yxr-2025@tt-a1i