Skip to content

docs check-links: checkDocs reports in readdir order, so its test flakes on some runners #943

Closed

Description

@nc9

docs/scripts/check-links.test.ts, test "checkDocs > checks a nested section named scripts, and matches redirect patterns", failed in CI on PR #942. That PR does not touch docs/scripts, and the same test passed on main at ec92c5e minutes earlier. The two expected messages came back in the other order:

-   "index.mdx:1: dead link /blog/a/b/amp",
    "guides/scripts/index.mdx:3: dead link /nowhere",
+   "index.mdx:1: dead link /blog/a/b/amp",

checkDocs builds its file list with walk() over readdirSync (docs/scripts/check-links.ts:51). The order readdirSync returns is filesystem-dependent, so on some runners the problems come out in a different order, while the test compares against a fixed array.

Acceptance Criteria

  • checkDocs reports problems in a deterministic order (files sorted by path, then by line) whatever order the filesystem lists them in.
  • docs/scripts/check-links.test.ts passes regardless of directory listing order; a test that lists the files in reverse order passes too.
  • bun run docs:check output on the real docs is unchanged apart from ordering.

Activity

  1. added
    bug
    documentation
    size: XS
    on Oct 19, 2026
  2. added a commit that references this issue on Oct 21, 2026
    886ceef
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

    bugdocumentationsize: XS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions