Skip to content

test/apps.test.mjs fails intermittently #8

Closed

Description

@nixfred

On one Omarchy machine test/apps.test.mjs failed in 4 of 14 runs, a different test each time ("logs, stop, uninstall", "stores without a manifest; apps needing what we lack are listed but refused with a reason", "apps holding their own port get a view gateway; a web port can come from exports.sh"), then passed 6 runs in a row. The cause is not known.

Starting points: the file opens real sockets (line 160) and node --test runs the test files at the same time. Commit 5149dd2 already fixed one flaky test.

Activity

  1. added a commit that references this issue on Nov 14, 2026
  2. MyOwnDataCenter commented on Nov 14, 2026

    @MyOwnDataCenter
    Owner

    Thank you for the careful report. Logging which test failed in each run pointed the right way. Accepted, and it turned up three separate causes, all fixed in aefa930:

    1. A real bug, not just a test problem: two state saves at the same moment shared one temporary file name, so one rename failed (ENOENT) and that change was lost. That is your "logs, stop, uninstall" failure. The new omarchyd/atomic.mjs runs writes to the same file one at a time, with unique temporary names. apps, machines, storage, updates and TLS settings all use it. A standalone check showed the old code failing 19 of 20 simultaneous saves; the new test saves 50 at once.
    2. Port clash: the test's app ports (38000–39500) were inside Linux's ephemeral range, so any outgoing connection could take one. That is your "stores without a manifest" failure. They now sit below 32768.
    3. Test files running together competed for ports, so npm test now runs files one at a time. It takes the same total time (about 32 s against 33 s).

    Omarchy theme commands also now run one after another, which removed an ordering flake in the theme test and is safer on a real system.

    Verified: 6 full runs under heavy CPU load, plus 6 normal runs, all 124 of 124.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions