summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-04-03 14:53:46 -0700
committerGitHub <noreply@github.com>2017-04-03 14:53:46 -0700
commitd076176a20963dee36de98048b57296b74d3cfbc (patch)
tree58d2ec6943eac13f5ef68ba492c401a7f77e45c3
parent58296dc0035e4f94a7b7cdc1db01887a3c3c1e30 (diff)
parent1441340124ede8dec7373d858fe33c70bac6f613 (diff)
downloadohai-d076176a20963dee36de98048b57296b74d3cfbc.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 8831e712..c8f8c3eb 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