• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bountx / LOB / 22869120259
88%

Build:
DEFAULT BRANCH: main
Ran 09 Mar 2026 06:42PM UTC
Jobs 1
Files 8
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Mar 2026 06:41PM UTC coverage: 83.476% (+0.5%) from 82.965%
22869120259

push

github

web-flow
feat: Implement watchdog mechanism for Binance and Kraken adapters to… (#31)

* feat: Implement watchdog mechanism for Binance and Kraken adapters to detect stale feeds and force reconnects

* test: Add feed data age sentinel tests for lastUpdateTimeMs

Tests verify the 0-sentinel pattern critical to the watchdog's
reconnect logic:
- DataAgeAbsentWhenSentinelIsZero: metric suppressed during startup/reconnect
- DataAgeEmittedAfterFirstUpdate: metric appears once book is live
- DataAgeValueApproximatelyCorrect: emitted value reflects elapsed seconds
- DataAgeSkipsZeroSentinelSymbolsInMultiSymbol: partial-data case
- DataAgeHeadersPresentWhenDataExists: HELP/TYPE headers present

* fix: Correct watchdog reconnect and clock consistency

Three fixes verified against current code:

1. Watchdog reconnect: webSocket.stop() alone does not trigger
   ixwebsocket auto-reconnect — add webSocket.start() immediately
   after stop() in both BinanceAdapter and KrakenAdapter watchdogs
   so the Open handler fires and re-enters the reconnect cycle.

2. Kraken watchdog placement: move watchdogThread_ creation to after
   both the connection wait and snapshot wait succeed in start().
   On any failure path webSocket_.stop() is called but no watchdog
   thread exists yet, eliminating the leaked-thread window.

3. steady_clock for lastUpdateTimeMs: staleness detection requires a
   monotonic clock; system_clock can jump backward on NTP adjustment
   and false-trigger a 2 s watchdog. Switch all lastUpdateTimeMs
   producers (handleWsMessage, handleBookSnapshot, handleBookUpdate)
   and consumers (runWatchdog x2, prometheus_format scrapeNowMs) to
   steady_clock. lastEventLagMs correctly stays on system_clock as it
   is compared against exchange-provided wall-clock timestamps.

* test: Fix data age tests to use steady_clock for lastUpdateTimeMs

The previous commit switched lastUpdateTimeMs to steady_clock; tests
were still using system_clock to populate the field, causing ... (continued)

14 of 14 new or added lines in 1 file covered. (100.0%)

389 of 466 relevant lines covered (83.48%)

35.2 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22869120259.1 09 Mar 2026 06:42PM UTC 8
83.48
GitHub Action Run
Source Files on build 22869120259
  • Tree
  • List 8
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22869120259
  • 0fc8e24c on github
  • Prev Build on main (#22862446985)
  • Next Build on main (#22902168186)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc