Skip to content
This repository has been archived by the owner on Jan 11, 2018. It is now read-only.

Commit

Permalink
Fix a bug when logging notifier timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Rozet <simon@rozet.name>
  • Loading branch information
bdotdub authored and sr committed Jun 1, 2009
1 parent 0f05e9b commit a80993f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/integrity/notifier/base.rb
Expand Up @@ -5,7 +5,7 @@ def self.notify_of_build(build, config)
Integrity.log "Notifying of build #{build.commit.short_identifier} using the #{to_s} notifier"
Timeout.timeout(8) { new(build.commit, config).deliver! }
rescue Timeout::Error
Integrity.log "#{notifier.name} notifier timed out"
Integrity.log "#{to_s} notifier timed out"
false
end

Expand Down
12 changes: 12 additions & 0 deletions test/unit/notifier_test.rb
Expand Up @@ -93,4 +93,16 @@ class NotifierTest < Test::Unit::TestCase

irc.notify_of_build(build)
end

it "handles notifier timeouts" do
irc = Notifier.gen(:irc)
Notifier.register(Integrity::Notifier::IRC)
build = Build.gen

stub.instance_of(Notifier::IRC).deliver! { raise Timeout::Error }
mock(Integrity).log(anything)
mock(Integrity).log("Integrity::Notifier::IRC notifier timed out") { nil }

irc.notify_of_build(build)
end
end

0 comments on commit a80993f

Please sign in to comment.