Skip to content

test: add unit tests for shutdown-state, request-tracker, and canary-… - #1365

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
akargi:feat/Request
Aug 28, 2026
Merged

test: add unit tests for shutdown-state, request-tracker, and canary-…#1365
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
akargi:feat/Request

Conversation

@akargi

@akargi akargi commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #1272

Title: test: add unit tests for shutdown-state, request-tracker, and canary-metrics services

Closes #1279

Body:
Adds focused unit test suites for three previously untested services:

Closes #1280

  • ShutdownStateService (14 tests) — idempotent markShuttingDown, reset lifecycle, getShutdownInfo fields
  • RequestTrackerService (25 tests) — middleware lifecycle events, waitForActiveRequests resolve/reject, forceCleanupRequest, getStatistics
  • CanaryMetricsService (14 tests) — getStats empty/populated, recordMirrorResult accumulation, evaluateCanary PROMOTE/ROLLBACK signals via env-var thresholds, minSampleSize guard

All 53 tests pass under the existing Jest config.

Closes #

…metrics services

Add focused unit test suites for three previously untested services:

- ShutdownStateService (14 tests): covers markShuttingDown idempotency,
  reset lifecycle, and getShutdownInfo field correctness.
- RequestTrackerService (25 tests): covers trackRequest middleware
  lifecycle events, waitForActiveRequests resolve/reject, forceCleanupRequest,
  and getStatistics aggregation.
- CanaryMetricsService (14 tests): covers getStats empty/populated states,
  recordMirrorResult accumulation, evaluateCanary PROMOTE/ROLLBACK signals
  via env-var thresholds, and minSampleSize guard.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@akargi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

akargi and others added 2 commits August 28, 2026 12:03
…metrics services

Add focused unit test suites for three previously untested services:

- ShutdownStateService (14 tests): covers markShuttingDown idempotency,
  reset lifecycle, and getShutdownInfo field correctness.
- RequestTrackerService (25 tests): covers trackRequest middleware
  lifecycle events, waitForActiveRequests resolve/reject, forceCleanupRequest,
  and getStatistics aggregation.
- CanaryMetricsService (14 tests): covers getStats empty/populated states,
  recordMirrorResult accumulation, evaluateCanary PROMOTE/ROLLBACK signals
  via env-var thresholds, and minSampleSize guard.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 11e14d6 into rinafcode:main Aug 28, 2026
3 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.

Add unit tests for shutdown-state service Add unit tests for request-tracker service Add unit tests for canary-metrics service

2 participants