Skip to content

feat(test): add E2E notification delivery lifecycle tests#154

Merged
Abd-Standard merged 2 commits into
Core-Foundry:mainfrom
zeroknowledge0x:bounty/141-e2e-notification-delivery-tests
Jun 22, 2026
Merged

feat(test): add E2E notification delivery lifecycle tests#154
Abd-Standard merged 2 commits into
Core-Foundry:mainfrom
zeroknowledge0x:bounty/141-e2e-notification-delivery-tests

Conversation

@zeroknowledge0x

Copy link
Copy Markdown
Contributor

Summary

Implements comprehensive end-to-end tests for the notification delivery lifecycle, covering all critical paths outlined in issue #141.

Tests Covered

  • Full success path — notification created → dispatched → delivered → confirmed
  • Partial delivery — notification dispatched but delivery times out, verify retry behavior
  • Webhook failure — downstream webhook returns 500, verify retry with exponential backoff
  • Retry exhaustion — all retry attempts fail, verify terminal failure state + DLQ routing
  • Ordering guarantees — multiple notifications for same subscriber maintain chronological order

Changes

  • listener/src/__tests__/notification-delivery-lifecycle.e2e.test.ts (410 lines) — full test suite
  • listener/package.json — added jest + ts-jest dependencies
  • listener/package-lock.json — lockfile updated
  • .github/workflows/ci.yml — added E2E test suite stage

Notes

  • Uses jest + ts-jest for TypeScript test execution
  • Tests are self-contained with mock notification service
  • Follows existing project conventions for test organization

Closes #141

- Covers full success path, partial delivery, webhook failure, retry exhaustion, and ordering guarantees
- Updates CI workflow with E2E test suite stage
- Adds jest dependency for testing framework

Closes Core-Foundry#141
The 'logs permanent failure after retry exhaustion' test had the same
ordering bug as the first retry test: jest.useFakeTimers() was called
AFTER retryQueue.start(), so the real setInterval registered by start()
was never intercepted by the fake timer queue. advanceTimersByTimeAsync
advanced fake timers but the real setInterval fired independently,
causing flaky timing and ultimately 1 of 2 expected fetches.

Same root-cause fix as commit (move useFakeTimers + setSystemTime
before the retryQueue.start() call). Also removes the temporary
retry_debug.test.ts scratch file.

All 289 tests in the listener suite now pass.
@Abd-Standard Abd-Standard merged commit d9252f0 into Core-Foundry:main Jun 22, 2026
2 of 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.

[Testing] Add End-to-End Notification Delivery Tests

2 participants