diff options
| author | Allen Hutchison <[email protected]> | 2025-08-01 14:33:33 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-01 21:33:33 +0000 |
| commit | 387706607dfa372f4f0c6fee14286bf4a290b258 (patch) | |
| tree | 353e559b91a6a03809ada72800b1f36d402d4c7c /packages/core/src/utils/bfsFileSearch.test.ts | |
| parent | dccca91fc944424b032b09d29afb85d225a71dcc (diff) | |
fix(tests): refactor integration tests to be less flaky (#4890)
Co-authored-by: matt korwel <[email protected]>
Diffstat (limited to 'packages/core/src/utils/bfsFileSearch.test.ts')
| -rw-r--r-- | packages/core/src/utils/bfsFileSearch.test.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/core/src/utils/bfsFileSearch.test.ts b/packages/core/src/utils/bfsFileSearch.test.ts index 3d5a0010..ce19f80e 100644 --- a/packages/core/src/utils/bfsFileSearch.test.ts +++ b/packages/core/src/utils/bfsFileSearch.test.ts @@ -258,10 +258,12 @@ describe('bfsFileSearch', () => { expect(avgDuration).toBeLessThan(2000); // Very generous limit // Ensure consistency across runs (variance should not be too high) - expect(consistencyRatio).toBeLessThan(1.5); // Max variance should be less than 150% of average + // More tolerant in CI environments where performance can be variable + const maxConsistencyRatio = process.env.CI ? 3.0 : 1.5; + expect(consistencyRatio).toBeLessThan(maxConsistencyRatio); // Max variance should be reasonable console.log( - `✅ Performance test passed: avg=${avgDuration.toFixed(2)}ms, consistency=${(consistencyRatio * 100).toFixed(1)}%`, + `✅ Performance test passed: avg=${avgDuration.toFixed(2)}ms, consistency=${(consistencyRatio * 100).toFixed(1)}% (threshold: ${(maxConsistencyRatio * 100).toFixed(0)}%)`, ); }); }); |
