juspay / juspay/decision-engine
Sticky routing: integration and e2e tests
- Dominant language
- Rust
- Stars
- 128
- Forks
- 36
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 34
Description
Part of #393 (sticky routing). **Status: implemented** in #422 (commit `b5d3e15`), pending review/merge.
Seven Playwright API tests run the loop against the live stack (sequentially — the features API has a shared-row lost-update race under parallel enables, tracked separately):
- a recorded success pins the customer (decided gateway + `STICKY_ROUTING` label)
- `stickyRouting: false` per-request opt-out suppresses the pin
- no sticky behavior without the merchant feature flag
- a retried payment sticks to the connector that finally succeeded
- sticky state is scoped to the payment-method combo
- gateway failures erode the habit until the pin releases (net counts, floor 0)
- a late webhook with inline fields records without the decide-time snapshot
Unit coverage rides the earlier PRs (key encoding/case-folding, prune-victim selection, nested-map assembly, scoring-gate classifiers). Deeper Redis-level integration tests (health-veto trip, admission-budget rollover, TTL/prune mechanics, cardinality bench) moved to #417 so they aren't lost when this closes.
Contributor guide
Assessment
This issue has not been assessed yet.