Skip to content

[$20 BOUNTY] feat: add tests for market stream reconnect backoff#7

Open
shadow6427 wants to merge 1 commit into
9904099:mainfrom
shadow6427:market-stream-tests
Open

[$20 BOUNTY] feat: add tests for market stream reconnect backoff#7
shadow6427 wants to merge 1 commit into
9904099:mainfrom
shadow6427:market-stream-tests

Conversation

@shadow6427

Copy link
Copy Markdown

Summary

Resolves the market stream backoff test bounty ($20).

Changes

  • Extracted BackoffHelper.calculate_delay from MarketStreamClient#schedule_reconnect without changing public stream behavior.
  • Retained the original production default behaviors (no jitter, same maximum cap).
  • Added tests/market_stream_test.rb covering initial delay, exponential growth, maximum cap, and jitter bounds.
  • Ensure the tests do not require external network access.

Validation

To validate locally without starting the whole suite, you can run:
ruby -I. v2/services/market_stream_test.rb
(Ensure minitest is available or run within bundle).

Checklist

  • Backoff helper extracted
  • Initial delay, exponential growth, maximum cap, and jitter bounds covered
  • Production defaults unchanged
  • Tests do not require external network access
  • Documented validation command

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.

1 participant