@root-manas/retrywise
v0.2.2
Published
Observe an HTTP client against a scripted loopback server and verify retry timing and request counts.
Maintainers
Readme
retrywise
Test an HTTP client's retry behavior with a local scripted server. Check how many requests it makes and whether it respects Retry-After.
Requires Node.js 22+. Install with npm i -D @root-manas/retrywise, or use npx @root-manas/retrywise.
Try it
npx @root-manas/retrywise --init retry-check
npx @root-manas/retrywise --config retry-check/config.json --format humanThe starter client receives a 503 with a one-second Retry-After, then a 200:
{
"command": "node",
"args": ["client.mjs"],
"responses": [
{ "status": 503, "retryAfterSeconds": 1 },
{ "status": 200 }
],
"expect": {
"minRequests": 2,
"maxRequests": 2,
"honorRetryAfter": true
},
"timeoutMs": 10000
}Replace the client script with your own and set the expected count and timing. retrywise does not add retries to your client; it observes what your client does. Use --format json for automation. Exit codes: 0 for no errors, 1 for failed checks, 2 for invalid input or execution errors.
Run against disposable local data. Timing tests can be noisy on heavily loaded machines; allow reasonable margins around retry delays.
