Configuration problem causing project builder to be incorrectly identified as "down"
Reported by Fabio Lessa | July 9th, 2009 @ 05:18 AM | in current
While looking at ticket #257 I noticed that the projects page always indicate the builder status to be "down". By digging into the problem, I found these errors on my log/#{project_name}_builder.log file:
[error] can't convert
ActiveSupport::Duration into time interval [error]
/Users/flessa/Code/Ruby/cruisecontrol.rb/app/models/polling_scheduler.rb:29:in
sleep' [error]
/Users/flessa/Code/Ruby/cruisecontrol.rb/app/models/polling_scheduler.rb:29:in
check_build_request_until_next_polling'
[error]
/Users/flessa/Code/Ruby/cruisecontrol.rb/app/models/polling_scheduler.rb:15:in
run'
build_request_checking_interval is set to an ActiveSupport::Duration value (using the num.seconds syntax) in the Configuration class, and sleep seems to be very strict about the type of "number" it expects...
>> 5.seconds == 5
=> true
>> 5.seconds.class
=> Fixnum
>> sleep 5.seconds
TypeError: can't convert ActiveSupport::Duration into time interval
from (irb):9:in `sleep'
from (irb):9
gotta love that magic ;)
I'm attaching a (really trivial) patch to fix the problem. I tried to find a good way of writing a test for it, but couldn't come up with anything that looked reasonable
Comments and changes to this ticket
-
Brian Guthrie July 10th, 2009 @ 02:13 PM
- Assigned user set to Fabio Lessa
- State changed from new to resolved
- Milestone set to current
Committed, with a couple of tweaks: to_i instead of to_int, and ensured that we retain attr_writer functionality.
Commit is ad403251f8ae2b77c26b3df054987882683d6300.
http://github.com/thoughtworks/cruisecontrol.rb/tree/ad403251f8ae2b... -
Chad Woolley August 25th, 2009 @ 12:01 AM
Fixed another related problem on another config variable:
http://github.com/thoughtworks/cruisecontrol.rb/commit/a14d4f373db6...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป