Skip to content

Repair three flaky Windows tests and the Windows source conformance run - #802

Merged
Zaldaryon merged 3 commits into
devfrom
test/config-retry-timeout-and-source-conformance
Nov 11, 2026
Merged

Zaldaryon merged 3 commits into
devfrom
test/config-retry-timeout-and-source-conformance

Conversation

@Pixnop

@Pixnop Pixnop commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Four test-harness repairs found while preparing 1.7.0-rc.2. None of them changes the product.

Config save-failure test. The CI run of the Windows coverage job timed out on "the failed-import marker and saveConfig > stays when that save does not reach the disk": 6185 ms against the default 5000 ms. The test points config.json at a folder, so the atomic write's rename fails. On Windows that is EPERM, and writeWithRenameRetry retries EPERM, EACCES and EBUSY for RENAME_RETRY_WINDOW_MS (3000 ms). That leaves about 2 s for module import, setup and a loaded runner, which was not enough. The test now gets a 15 s timeout, the same value the renderer-dom project in vitest.config.ts already uses for loaded Windows runners, with a comment giving the reason. Fake timers do not fit: the window is a performance.now deadline around real disk I/O.

Windows source conformance. windows-conformance.yml runs tests/e2e/windows-install.ts with tsx and has failed since archiveValidation.ts started importing @domain/worlds/worlds on 15 September. The aliases live in tests/e2e/tsconfig.json, but tsx read the root tsconfig, which has none, so the module could not be found. The step now runs npx tsx --tsconfig tests/e2e/tsconfig.json tests/e2e/windows-install.ts, the same project the workflow's typecheck step already uses.

I checked the sibling workflow and the scripts. packaged-windows-conformance.yml runs packaged-windows-install.ts, whose imports all load with a bare tsx, so it stays as it is. No other tsx call exists in the workflows or in package.json.

Config export picker test. The CI run for pull request #790 (run 42913437304, Windows, Node 22) timed out on "opens the picker on a folder past the pack entry ceiling" after 15 s, in a run that took 476 s against about 338 s on another Windows leg. The test listed 2001 configs, so the dialog put 2001 rows in jsdom and rendered them all again after every click: about 0.8 s to open the picker and 0.25 s for each click and for the export, 1.8 s in total on a quiet machine, which a slow runner multiplies past the limit. The ceiling is shared by mods, servers and configs, so the test now supplies 1997 mods as data and lists 4 configs, which leaves room for 3. It still pins the folder count, the unticked start, the disabled export button and the exported subset, now after three ticks, and it now also checks that the remaining box greys out once the pack is full.

Backup restore test. The CI run for pull request #793 (run 42918666923, Windows, Node 26, first attempt) failed on "puts two names for one inode back as two ordinary files" with Expected "actual" to be strictly unequal to: 12384898976636368, and passed on a rerun. That number is above 2^53. On NTFS a file id is 64 bits and a plain lstat returns it as a double, so two different files whose ids differ in the lowest bit can read as the same number (12384898976636368 and 12384898976636369 both become 12384898976636368). The two nlink assertions just above had passed, so the restore had not produced a hard link: the test was comparing rounded numbers. It now proves independence by behaviour, writing to one restored file and checking that the other keeps its bytes, and the fixture check that the two source names share a file reads the ids as bigint.

Type

  • Bug fix
  • Feature
  • Performance
  • Refactor or cleanup
  • Tests only
  • Docs or build

Checklist

  • Targets dev, not main.
  • npm run typecheck passes.
  • npm run lint:ci passes.
  • npm run format:check passes.
  • npm run test:coverage passes, coverage at or above the floor in vitest.config.ts.
  • npm run build:unpack passes.

Testing

Full suite on the first commit: 5910 passed, 4 skipped, 303 files. Coverage: 95.07% statements, 91.29% branches, 95.89% functions, 97.02% lines. Typecheck, lint:ci (0 errors) and format:check are clean. One earlier full run had the config export picker test time out under load, the same test the third repair makes lighter; it passed on the next run.

The timeout test cannot be shown failing on dev from Linux. There the rename onto a folder is EISDIR, which is not retried. I simulated the Windows EPERM case instead: the save spent 3104 ms in the retry window and the test took 3418 ms in total, which leaves under 2 s of margin at the old 5 s limit and plenty at 15 s.

The picker test went from 1.7 s to 0.2 s of test time (five runs each, 1.64 to 1.76 s before and 0.196 to 0.208 s after), and the whole file passes in 3.3 s of test time.

The backup restore test passed five runs in a row after the change, and its new check holds on any filesystem because it does not read inode numbers at all.

For the workflow, I loaded archiveValidation and innoExtraction with tsx from the sources. Without --tsconfig both fail with "Cannot find module '@domain/worlds/worlds'". With --tsconfig tests/e2e/tsconfig.json both load. I did not run the conformance script locally, since it launches the launcher. I ran the workflow on this branch instead: run 42904859198 is green, so the script loads again on the Windows runner. The packaged build is left to CI.

Related issues

None.

…he Windows source conformance with the e2e tsconfig
@Pixnop
Pixnop requested a review from Zaldaryon November 10, 2026 21:25
@Pixnop Pixnop changed the title Repair the config save-failure test timeout and the Windows source conformance run Repair two Windows test timeouts and the Windows source conformance run Nov 10, 2026
@Pixnop Pixnop changed the title Repair two Windows test timeouts and the Windows source conformance run Repair three flaky Windows tests and the Windows source conformance run Nov 10, 2026

@Zaldaryon Zaldaryon 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.

The workflow now runs tsx with the E2E tsconfig, the Windows timeout covers the existing three-second rename retry, and the restore test avoids comparing rounded NTFS file IDs. The export test still exercises the combined pack ceiling with 1,997 Mods and four config files. Focused tests passed: 228, with 1 skipped. Windows source conformance run 42904859198 passed on e20c1e3, which contains the workflow change. Required CI checks are green.

@Zaldaryon
Zaldaryon merged commit e17262c into dev Nov 11, 2026
12 checks passed
@Zaldaryon
Zaldaryon deleted the test/config-retry-timeout-and-source-conformance branch November 11, 2026 10:24
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