Skip to content

test: improve CI stability for performance and utility test suite#392

Open
aniket-shikhare-cstk wants to merge 9 commits into
developmentfrom
feature/comprehensive-integration-tests
Open

test: improve CI stability for performance and utility test suite#392
aniket-shikhare-cstk wants to merge 9 commits into
developmentfrom
feature/comprehensive-integration-tests

Conversation

@aniket-shikhare-cstk

Copy link
Copy Markdown
Contributor

Summary

  • Add jest.retryTimes(2) with a 4-second afterEach delay to performance-sensitive test files so transient failures caused by shared CI server load get a chance to recover before being counted as a real failure
  • Raise CPU-only timing thresholds in VersionUtility tests from < 100ms / < 200ms to < 500ms — the originals were calibrated for an idle machine and are too tight when the CI node is under concurrent load

Files changed

File Change
test/integration/PerformanceTests/PerformanceBenchmarks.test.js Add retryTimes(2) + 4s inter-retry delay
test/integration/PerformanceTests/StressTesting.test.js Add retryTimes(2) + 4s inter-retry delay
test/integration/NetworkResilienceTests/ConcurrentRequests.test.js Add retryTimes(2) + 4s inter-retry delay
test/integration/UtilityTests/VersionUtility.test.js Add retryTimes(2) + raise CPU thresholds to 500ms

How the retry delay works

In jest-circus (Jest 27+) afterEach hooks run between retry attempts, so an afterEach(async () => sleep(4000)) inside a describe block naturally inserts a 4-second pause before each re-run without needing any custom test runner.

Test plan

  • npm run test:e2e passes locally
  • Performance and concurrent request tests no longer produce transient failures under CI load
  • No production source code changed — test files only

harshitha-cstk and others added 9 commits June 29, 2026 02:25
…cy folders

Moved test coverage from test/asset and test/entry into the integration
test suite (AssetQuery, ImageTransformation, ErrorHandling, UtilityMethods).
Deleted the now-redundant test/asset and test/entry directories.
…t tests

Performance tests with timing assertions (expect(duration).toBeLessThan)
and concurrent load tests were intermittently failing on dev11 when 60+
sanity pipelines run simultaneously, slowing API response times.

- jest.retryTimes(2, { logErrorsBeforeRetry: true }) retries each failed
  test up to 2 times
- afterEach(sleep 4000ms) provides a ~4s recovery window between attempts;
  in jest-circus afterEach runs between retry attempts

Applies to:
- PerformanceBenchmarks.test.js (19 tests)
- StressTesting.test.js (14 tests)
- ConcurrentRequests.test.js (15 tests)
…ests

Perf_UserAgentGeneration_Fast failed on dev11 pipeline (received 161ms vs
expected < 100ms). The test does 1000 template string constructions — pure
CPU work — so the threshold was unrealistically tight for a shared CI node
running 60+ concurrent sanity pipelines.

- Raise toBeLessThan(100) → toBeLessThan(500): still validates the
  operation is fast, but gives headroom under CPU contention
- Add jest.retryTimes(2) + afterEach(4s sleep) to the describe block,
  consistent with the other performance test files, to handle momentary
  CPU spikes that drop after a short wait
@aniket-shikhare-cstk aniket-shikhare-cstk requested review from a team as code owners June 29, 2026 11:19
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.

5 participants