summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-04-03 14:53:46 -0700
committerTim Smith <tsmith@chef.io>2017-05-08 12:32:51 -0700
commit3bfa5410ffc61b1bfc4e8846981ad6c1251b61c1 (patch)
tree202d83da7f1276679a7daa43709be2105eff12a8
parent045f31d506b9191df0b0dcf7e21a746fd4885432 (diff)
downloadohai-3bfa5410ffc61b1bfc4e8846981ad6c1251b61c1.tar.gz
Merge pull request #976 from chef/timeouts
Shorten the sbt shellout timeout period
-rw-r--r--lib/ohai/plugins/scala.rb2
-rw-r--r--spec/unit/plugins/scala_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/scala.rb b/lib/ohai/plugins/scala.rb
index 1f019bb2..22e34d82 100644
--- a/lib/ohai/plugins/scala.rb
+++ b/lib/ohai/plugins/scala.rb
@@ -35,7 +35,7 @@ Ohai.plugin(:Scala) do
# Check for sbt
begin
# sbt launcher version 0.13.7
- so = shell_out("sbt --version")
+ so = shell_out("sbt --version", timeout: 5)
if so.exitstatus == 0
scala[:sbt] = Mash.new
scala[:sbt][:version] = so.stdout.split[3]
diff --git a/spec/unit/plugins/scala_spec.rb b/spec/unit/plugins/scala_spec.rb
index f85c577c..45eb77c7 100644
--- a/spec/unit/plugins/scala_spec.rb
+++ b/spec/unit/plugins/scala_spec.rb
@@ -33,7 +33,7 @@ describe Ohai::System, "plugin scala" do
.with("scala -version")
.and_return(mock_shell_out(0, "", scala_out))
allow(plugin).to receive(:shell_out)
- .with("sbt --version")
+ .with("sbt --version", { :timeout => 5 })
.and_return(mock_shell_out(0, sbt_out, ""))
end
@@ -80,7 +80,7 @@ describe Ohai::System, "plugin scala" do
.and_return(mock_shell_out(0, "", scala_out))
allow(plugin).to receive(:shell_out)
- .with("sbt --version")
+ .with("sbt --version", { :timeout => 5 })
.and_raise( Ohai::Exceptions::Exec )
plugin.run
end