Skip to content

tests: load test fonts in a deterministic order - #1136

Merged
DJMcNab merged 1 commit into
linebender:mainfrom
luisbg:fix/deterministic-test-font-order
Sep 16, 2026
Merged

DJMcNab merged 1 commit into
linebender:mainfrom
luisbg:fix/deterministic-test-font-order

Conversation

@luisbg

@luisbg luisbg commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

fontdb::load_fonts_dir walks the directory with std::fs::read_dir, which outputs entries in filesystem order. That order is not stable across machines, and the test harness depends on it.

Replace load_fonts_dir with an explicit sorted list so order is identical everywhere. The whole suite passes unchanged, so no stored reference image depended on the previous ordering.

`fontdb::load_fonts_dir` walks the directory with `std::fs::read_dir`,
which outputs entries in filesystem order. That order is not stable across
machines, and the test harness depends on it.

Replace `load_fonts_dir` with an explicit sorted list so order is
identical everywhere. The whole suite passes unchanged, so no stored
reference image depended on the previous ordering.

@DJMcNab DJMcNab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure. Test code is low enough risk, especially if CI still passes...

This probably should use an unstable sort, but I can't be bothered fixing that.

@DJMcNab
DJMcNab merged commit 75b6bba into linebender:main Sep 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants