Skip to content

Add market stream reconnect backoff tests#20

Open
qingfeng312 wants to merge 1 commit into
9904099:mainfrom
qingfeng312:qingfeng/market-backoff-tests-3
Open

Add market stream reconnect backoff tests#20
qingfeng312 wants to merge 1 commit into
9904099:mainfrom
qingfeng312:qingfeng/market-backoff-tests-3

Conversation

@qingfeng312

Copy link
Copy Markdown

Summary

Adds a small testable reconnect backoff helper for v2/services/market_stream.rb and focused Minitest coverage for the required delay behavior without loading network dependencies.

/claim #3
Closes #3

Changes

  • Added MarketStreamReconnectBackoff.delay with production-equivalent defaults when called from MarketStreamClient#schedule_reconnect.
  • Added tests for initial delay, exponential growth, maximum cap, jitter lower/upper bounds, and max-cap behavior with jitter.
  • Kept tests isolated from EventMachine, Sinatra, Redis, and real network connections by requiring only the helper module.
  • Included the generated diagnostic JSON from python3 build.py; no encrypted .logd artifact was produced locally.

Testing

  • ruby v2/services/market_stream_reconnect_backoff_test.rb
  • ruby -c v2/services/market_stream.rb
  • ruby -c v2/services/market_stream_reconnect_backoff.rb
  • git diff --check
  • python3 build.py generated diagnostic/build-2b54872c.json; frontend and v2-market-stream passed, while backend/market/engine/compliance/nfc/openapi modules failed locally because required toolchains or platform-specific build support were unavailable (cargo, go, cmake, Java runtime, luac, ghc, and macOS MAP_HUGETLB).

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build JSON is committed in this PR
  • Diagnostic .logd artifact is committed in this PR. It was not created by the local build run; the included diagnostic JSON records the failure.
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

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.

[$20 BOUNTY] [Ruby] Add tests for market stream reconnect backoff

1 participant