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

ben-manes / caffeine / #4724 / 1
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: v3.dev
DEFAULT BRANCH: master
Ran 22 Jan 2025 03:23AM UTC
Files 78
Run time 3s
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 02:36AM UTC coverage: 99.07% (+0.03%) from 99.044%
#4724.1

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.

7672 of 7744 relevant lines covered (99.07%)

0.99 hits per line

Source Files on job #4724.1
  • Tree
  • List 78
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4724
  • 00a46079 on github
  • Prev Job for on v3.dev (##4723.1)
  • Next Job for on v3.dev (##4725.1)
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