apache / apache/maka

test(desktop): full Node suite fails in local Windows platform fixtures and cleanup

Open
#5,059 1 comment 0 reactions 1 assignee Claimed by @99Gaoxiaoqi View on GitHub
bug
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
696

Description

### What happened

A clean build succeeded on Windows, but the full Desktop Node test suite then reported 24 failures at commit `21d1609f4fce5f349045adbda0364576df81400d`. An independently built snapshot for #5010 reproduced 23 of those failures with matching normalized error signatures. This report concerns those 23 shared failures across seven test files.

These are observations from one Windows machine; they have not been reproduced on a second machine, hosted Windows runner, or current main. Four failures occur while creating symlinks and depend on local privileges. The other groups have platform-sensitive fixtures or cleanup code that warrant investigation, rather than establishing that the corresponding product features are broken.

Related: #2624 tracks the Windows baseline workflow. This report covers `@maka/desktop test:dist`, not that workflow's smoke/Storage/PTY selection, and does not invalidate its previously recorded clean runs. #5058's `test` check passed at `24219c259697474a9092948d605b229bee45173f`; its required `test` workflow runs on Ubuntu, so that result does not establish a clean Windows full Desktop suite.

Expected: portable fixtures should exercise their intended behavior on Windows. Tests requiring unavailable platform capabilities should document prerequisites or explicitly handle those capabilities; cleanup should close resources before removing their files.

### How to reproduce

Suggested reproduction from a new checkout on Windows, using Node 24 and npm 11.19.0:

```sh
git clone https://github.com/apache/maka.git maka-windows-test-repro
cd maka-windows-test-repro
git checkout --detach 21d1609f4fce5f349045adbda0364576df81400d
npm ci
npm run build
npm --workspace @maka/desktop run test:dist
```

The recorded comparison reused installed dependencies rather than running the fresh `npm ci` sequence above. It used the following desktop test inputs and execution flags, replacing the default reporter with a machine-readable reporter:

```sh
cd apps/desktop
node --test --test-force-exit "dist/main/**/*.test.js" scripts/dev-app-runtime.test.mjs scripts/vite-workspace-packages.test.mjs
```

Both snapshots were built independently without copying generated dist files or tsbuildinfo. They reused the same installed third-party dependencies; internal workspace dependencies were linked within each snapshot and rebuilt. Two fresh npm installations were not performed. Runs were sequential.

Reproduction of the symlink failures depends on the account/environment's symlink permissions. The exact Windows edition, build and Developer Mode setting were not captured, so those four failures should be treated as capability-dependent observations.

### Environment

- Surface: Desktop Node test suite, built from source.
- OS: Windows x64; exact OS build not recorded.
- Node.js: v24.20.0.
- npm: 11.19.0.
- Baseline commit: `21d1609f4fce5f349045adbda0364576df81400d`.
- Lockfile SHA-256: `686e1dbdeb940955231bf4abef9a3e03e98736fbe6ba30b36e5bb201f92b871e`.
- Comparison run: September 8, 2026 UTC.

### Logs, screenshots, or additional context

Suite result | Clean baseline | Candidate snapshot |
|---|---:|---:|
| Total | 2507 | 2513 |
| Passed | 2475 | 2482 |
| Failed | 24 | 23 |
| Skipped | 8 | 8 |

The candidate added six passing tests and restricted a POSIX permission assertion to non-Windows, explaining the 24-to-23 failure count. All 23 shared failures had matching normalized errors; normalization removed checkout roots and random temporary-directory names. The candidate is an earlier local snapshot, not an exact rerun of the final #5058 commit. The baseline alone is sufficient to observe these failures; #5058 is not required for reproduction.

Observed failure groups (source files under `apps/desktop/src/main/__tests__/`):

| File(s) | Count | Observed failure and likely cause |
|---|---:|---|
| `runtime-host-local-remote-access.test.ts` | 12 | Fixtures declare POSIX operators but receive Windows absolute paths. Path validation fails; two assertions then receive `unavailable` instead of expected `unsupported`. |
| `rive-workflow-tool.test.ts` | 5 | Fake CLI fixtures use Unix `#!/bin/sh` scripts. Observed errors include `Rive binary was not found in PATH`, `rive_not_installed` instead of `timeout`/`bad_json`/`rive_failed`, and a success assertion receiving `false`. The fixture's execution strategy appears incompatible with this Windows run. |
| `computer-use-host.test.ts`, `managed-skill-sources.test.ts`, `open-path-guard.test.ts` | 4 | Fixture symlink creation fails with `EPERM` in this environment (one, one and two failures respectively). |
| `goals-boundary.test.ts` | 1 | Assertion compares Windows backslashes against slash-separated expected paths. |
| `project-management-service.test.ts` | 1 | Cleanup encounters `EBUSY` removing `runtime.sqlite`. Source inspection shows no catalog close before directory removal in the failing test, making an unreleased database handle a likely cause. No targeted close-and-rerun experiment has established causality. |

The seven affected source files were unchanged in the candidate comparison. Electron E2E cleanup failures and unrelated stale generated test files are excluded from these counts.

A later read-only check of main at `9cb5cc93c03f8d07550e739164d5e33168892563` found all seven test files byte-identical to the recorded baseline. This does not establish that their dependencies or runtime behavior are unchanged; the suite has not been rerun at that newer commit.

Representative recorded errors (local temporary paths abbreviated):

```text
Runtime Host operator module path must be an absolute posix path
Runtime Host legacy operator executable must be an absolute posix path
Expected 'unsupported', received 'unavailable'
Expected 'timeout', received 'rive_not_installed'
EPERM: operation not permitted, symlink '/source' -> '/link'
EBUSY: resource busy or locked, unlink '/storage/runtime.sqlite'
```

For the Goals assertion, source inspection shows `path.relative()` output compared against hard-coded forward-slash paths. The recorded Windows output contains backslashes.

Please help confirm the platform-sensitive failures on another Windows environment and determine the intended capability prerequisites for the four symlink tests. The groups can be split into focused fixes once reproduced.

Prepared with OpenAI Codex: evidence analysis and issue drafting.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.