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

ben-manes / caffeine / #4725
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 22 Jan 2025 06:00AM UTC
Jobs 1
Files 78
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

22 Jan 2025 05:08AM UTC coverage: 99.057% (+0.01%) from 99.044%
#4725

push

github

ben-manes
improve the handling of negative durations with variable expiration

A zero or negative duration returned from the user's Expiry is treated
as an immediate expiration. A negative value was being hashed into a
future slot in the second wheel, so it delayed the eviction until that
bucket is flushed. This now forces the entry to the current time's
bucket so that it gets handled immediately after being added.

I suspect that if a Long.MIN_VALUE was used that there might have been
an overflow. I didn't investigate that scenario or its impact, as users
can just return zero or a reasonably negative duration instead if oddly
intentional. The primary cause for a negative if a mistakenly ordered
Duration.between(t1, t2) call, so handling -292 years is a worthy test
case but bad user code entries are unintentionally, immediatly
discarded.

8 of 8 new or added lines in 2 files covered. (100.0%)

7671 of 7744 relevant lines covered (99.06%)

0.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #4725.1 22 Jan 2025 06:00AM UTC 78
99.06
Source Files on build #4725
  • Tree
  • List 78
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #4725
  • 88226ef5 on github
  • Prev Build on master
  • Next Build on v3.dev
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