test(engine): fix flaky Windows timeout in git-files scope test#372
Merged
Conversation
The `resolveScopedFiles > warns when file scope exceeds threshold` test created 1001 real files plus `git add .` to trip the file-count warning. On Windows CI runners that filesystem work exceeded the per-test 30s timeout, killing `git add .` mid-run (exit 143 = SIGTERM) and flaking the Windows smoke test. Make the warn threshold injectable via an optional `fileWarnThreshold` parameter on `resolveScopedFiles` (defaults to SCOPE_FILE_WARN_THRESHOLD). The test now injects a threshold of 5 and creates only 6 files — fast and deterministic on every platform — and drops the 30s per-test override (which was tighter than the 60s global, making timeouts more likely). Capture the pattern in ARCH-005 (Testing Standards). Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Deploying archgate-cli with
|
| Latest commit: |
ada3df3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2e57b100.archgate-cli.pages.dev |
| Branch Preview URL: | https://fix-git-files-scope-threshol.archgate-cli.pages.dev |
oxfmt formats markdown too — normalize emphasis markers in the testing-standards ADR so `bun run format:check` passes in CI. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Contributor
Code Coverage
Full HTML report available in workflow artifacts. Per-directory breakdown
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a recurring Windows smoke-test flake in
tests/engine/git-files.test.ts(most recently observed on #366).The test
resolveScopedFiles > warns when file scope exceeds thresholdcreated 1001 real files +git add .to trip the file-count warning. On Windows CI runners that filesystem work exceeded the test's 30s timeout, sogit add .was SIGTERM'd mid-run (git add . failed (exit 143), 143 = 128 + SIGTERM), failing the suite non-deterministically. It does not reproduce locally on faster filesystems.Changes
src/engine/git-files.ts—resolveScopedFilesgains an optionalfileWarnThreshold?: number(defaults to the existingSCOPE_FILE_WARN_THRESHOLD = 1000); the warn condition uses it.tests/engine/git-files.test.ts— the test injectsfileWarnThreshold: 5and creates only 6 files instead of 1001, and drops the per-test30_000override (which was tighter than the global--timeout 60000, making timeouts more likely)..archgate/adrs/ARCH-005-testing-standards.md— captures the pattern: make large production thresholds injectable; don't materialize giant fixtures to cross a threshold; never lower a per-test timeout below the global.No production behavior change — the default threshold is unchanged.
Test plan
bun test tests/engine/git-files.test.ts— 31 pass / 0 failbun run validate— lint, typecheck, format, full suite (1212 pass / 0 fail), ADR check 30/30