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

mperham / sidekiq / 2028
46%

Build:
DEFAULT BRANCH: master
Ran 20 Feb 2015 12:43AM UTC
Jobs 5
Files 48
Run time 3min
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

pending completion
2028

Pull #2198

travis-ci

dstosik
MyWorker.perform_in(1.month) does not always schedule job in one month.

At the moment, `MyWorker.perform_in(1.month)` always schedules a job in 30
days. When added to a date, `1.month` will add 1 to the date's month count,
which means that it will add 28, 29, 30, or 31 days depending on the month and
year.
When I call `MyWorker.perform_in(1.month)`, I would expect the job to be
scheduled next month, same day of the month, all the time. At the moment, it is
true only four months in the year.
My pull request tries to fix this by converting the interval object to a Float
at the last possible moment.
Plaese note that the test I wrote will fail only during months that do not have
30 days. Ideally, I would add a dependency to Timecop and freeze time to any
day in a month of 28, 29 or 31 days. This could also avoid using
`#assert_in_delta`, in favour of `#assert_equal`.

Feel free to read my blog post [Rails' `1.month` has a variable
length](http://dstosik.github.io/rails/2015/02/19/rails-1month-variable-length/)
for more details.
Pull Request #2198: MyWorker.perform_in(1.month) does not always schedule job in one month.

3 of 3 new or added lines in 1 file covered. (100.0%)

2141 of 2491 relevant lines covered (85.95%)

136.74 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
100.0
lib/sidekiq/api.rb
2
100.0
lib/sidekiq/cli.rb
3
100.0
lib/sidekiq/web_helpers.rb
18
100.0
lib/sidekiq/web.rb
Jobs
ID Job ID Ran Files Coverage
2 2028.2 (2.0.0) 20 Feb 2015 12:43AM UTC 0
85.94
Travis Job 2028.2
3 2028.3 (2.2) 20 Feb 2015 12:43AM UTC 0
86.2
Travis Job 2028.3
4 2028.4 (jruby-19mode) 20 Feb 2015 12:44AM UTC 0
85.76
Travis Job 2028.4
5 2028.5 (jruby) 20 Feb 2015 12:44AM UTC 0
85.84
Travis Job 2028.5
6 2028.6 (rbx-2) 20 Feb 2015 12:46AM UTC 0
94.11
Travis Job 2028.6
Source Files on build 2028
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2028
  • Pull Request #2198
  • PR Base - master (#2027)
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