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

trotzig / diffux / 369 / 2
99%
master: 99%

Build:
DEFAULT BRANCH: master
Ran 13 Apr 2014 05:52AM UTC
Files 32
Run time 2s
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

13 Apr 2014 05:45AM UTC coverage: 98.701%. Remained the same
2.1.0

push

travis-ci

trotzig
Wait until page is ready before taking snapshot

Before this commit, we used to wait five seconds before taking the
snapshot. We did this to make sure that asynchronously loaded
elements had time to render on the page. This solved most of the
problems, but we always wanted something more robust. This commit
attempts to replace the timeout-based solution with one that listens
events fired when resources are fetched, and trigger the snapshot as
soon as we're no longer waiting for anything.

PhantomJS has two methods that you can implement to solve things like
this: `onResourceRequested` and `onResourceReceived`. We implement these
and keep a list of active resources. As soon as a (potentially) last
resource is received, we start a short timer which will trigger the
snapshot to be taken. If another resource is needed within the timeframe
of that running timer, we cancel the snapshot-taking and start waiting
for the response for the (potentially) last resource once more.

If this strategy for some reason fails, there's a 20 second fallback
timer that will trigger the snapshot. And in case no resources are
requested from the page at all, there is a 1 second initial timer that
will trigger the snapshot.

All in all, a fairly complicated structure. My initial testing shows a
significant improvement though. Fast pages are snapshotted way faster
(down to 2.5 seconds) and I haven't noticed any issues with more
complicated pages.

608 of 616 relevant lines covered (98.7%)

45.99 hits per line

Source Files on job 369.2 (2.1.0)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 369
  • Travis Job 369.2
  • 391c4d9b on github
  • Prev Job for 2.1.0 on master (#368.2)
  • Next Job for 2.1.0 on master (#370.2)
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