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

d-led / gen_server_virtual_time / 2b39b5d416a9235330d168782c773e552803c419
88%

Build:
DEFAULT BRANCH: main
Ran 11 Sep 2026 09:06PM UTC
Jobs 1
Files 19
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

11 Sep 2026 09:05PM UTC coverage: 86.305%. Remained the same
2b39b5d416a9235330d168782c773e552803c419

push

github

d-led
test: make statements real, drop sleep-based synchronisation

The suite synchronised with Process.sleep/1 in 39 places and, in several of
them, asserted nothing at all. Both hid real problems.

Sleeps that stood in for an ordering guarantee are gone. A synchronous call is
already handled after the messages queued before it, and advance/2 returns only
once the actors it delivered to have acknowledged, so neither needed a settling
delay. Where the effect could not be observed from the outside, the test now
waits for it (WaitUntil.wait_until/2) or monitors the process instead of
guessing. Four sleeps remain, each deliberate and documented: two gen_server
timeouts cannot be polled because every message resets them, and two :slow
tests exist precisely to show that real time is slow.

Three tests claimed to exercise virtual time and did not. They called
send_after/3 from the test process, which selects *that* process's backend -
real time by default - so the clock advance moved nothing and the assertion
that followed was vacuous. Scheduling now happens inside the server, which is
the documented pattern, and the tests assert the resulting state.

Tests that slept and then stopped the server now assert what they were named
for: cancellation leaves the count at zero and reports the remaining virtual
time, a cancelled timer never fires, per-instance clocks advance independently
of each other, send_after_self/2 delivers to the caller, and simulating a
virtual second costs less than a real one - which is the library's central
claim.

Two assertions were tightened rather than left loose now that the guarantee
holds: a 10s advance produces exactly ten ticks, and ten timers across a
virtual second are all delivered.

Verified: formatting, compile --warnings-as-errors, 389 tests passing, the slow
and diagram groups, Credo (no new issues), and 0 failures in 8 consecutive full
runs.

2067 of 2395 relevant lines covered (86.3%)

4788.88 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2b39b5d416a9235330d168782c773e552803c419.1 11 Sep 2026 09:06PM UTC 19
86.3
GitHub Action Run
Source Files on build 2b39b5d416a9235330d168782c773e552803c419
  • Tree
  • List 19
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2b39b5d4 on github
  • Prev Build on main (#C08AC29E...)
  • Next Build on main (#C0FD7864...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc