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

rm-hull / dot-block / 26723078796
47%

Build:
DEFAULT BRANCH: main
Ran 31 May 2026 08:06PM UTC
Jobs 1
Files 20
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

31 May 2026 08:04PM UTC coverage: 41.921% (+0.06%) from 41.862%
26723078796

push

github

web-flow
fix: add race detection and thread-safe sketches (#124)

* refactor: implement asynchronous cache updates

Introduced `DNSCache` with an update worker pattern to offload cache
writes to a background channel, reducing latency for primary request
processing paths. Decoupled metrics from the concrete cache type using
an interface.

* test: use assert.Eventually for cache stats verification

The previous direct assertions were flaky due to potential race
conditions where cache stats were updated asynchronously. Polling
ensures the test waits for the internal state to stabilize.

* refactor: move cache worker log to constructor

Move the startup log message from the goroutine to the constructor to
ensure the message is emitted immediately upon initialization.

* feat: add race detection and thread-safe sketches

- Enable `-race` flag in CI test workflow to catch concurrency issues.
- Introduce `SafeSketch` wrapper for `hyperloglog.Sketch` to prevent
  data races during concurrent access in `DnsMetrics`.

* feat: add Close method to DNSCache

- Add a `done` channel to coordinate worker shutdown.
- Update `runUpdateWorker` to respect the lifecycle.
- Add `Close()` method to allow graceful termination of the worker.

* fix: ensure dispatcher resources are closed

Added a `Close` method to `DNSDispatcher` and invoked it in `RunServer`
using `defer` to prevent resource leaks when the application exits.

* refactor: use pointer for DNSCache in CacheReaper

Updated the `CacheReaper` struct to hold a pointer to `DNSCache` instead
of a value type to avoid unnecessary copying and maintain consistency
with the `DNSDispatcher` implementation.

* refactor: remove unnecessary //go:inline directives

* test: add cache verification in DNS dispatcher test

Ensure the cache item is retrievable before asserting stats in
`TestDNSDispatcher_HandleDNSRequest_CacheHit` to prevent race
conditions where cache stats update before the item is fully
accessible.

* refactor: add shutd... (continued)

6 of 11 new or added lines in 1 file covered. (54.55%)

576 of 1374 relevant lines covered (41.92%)

1268.36 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
88.0
-2.71% internal/metrics/dns_metrics.go
Jobs
ID Job ID Ran Files Coverage
1 26723078796.1 31 May 2026 08:06PM UTC 20
41.92
GitHub Action Run
Source Files on build 26723078796
  • Tree
  • List 20
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d0adbfff on github
  • Prev Build on main (#26719808190)
  • Next Build on main (#26724406601)
  • 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