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

rm-hull / dot-block / 26719808190
47%

Build:
DEFAULT BRANCH: main
Ran 31 May 2026 05:44PM 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 05:43PM UTC coverage: 41.862% (+2.0%) from 39.876%
26719808190

push

github

web-flow
refactor: implement asynchronous cache updates (#123)

* 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 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 shutdown channel and cleanup dispatcher tests

- Added `done` channel to `DNSCache` to support proper lifecycle
management.
- Fixed typo in logger field name (`maxCcheSize` -> `maxCacheSize`).
- Added `t.Cleanup(dispatcher.Close)` to unit tests to prevent ... (continued)

83 of 111 new or added lines in 5 files covered. (74.77%)

1 existing line in 1 file now uncovered.

571 of 1364 relevant lines covered (41.86%)

0.45 hits per line

Uncovered Changes

Lines Coverage ∆ File
18
71.88
internal/forwarder/cache.go
6
0.0
0.0% internal/forwarder/cache_reaper.go
2
0.0
0.0% internal/app.go
2
85.15
0.22% internal/forwarder/dispatcher.go

Coverage Regressions

Lines Coverage ∆ File
1
85.15
0.22% internal/forwarder/dispatcher.go
Jobs
ID Job ID Ran Files Coverage
1 26719808190.1 31 May 2026 05:44PM UTC 20
41.86
GitHub Action Run
Source Files on build 26719808190
  • Tree
  • List 20
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 735715da on github
  • Prev Build on main (#26719677425)
  • Next Build on main (#26723078796)
  • 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