diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-08-28 16:40:52 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-08-28 16:40:52 -0700 |
commit | c106a633ef28f5d53cac6bfa64adaddd3aa2f9ca (patch) | |
tree | 2169aa191c9de1fc35a106a7af4249c0e8f02852 /spec/support | |
parent | afb519b0a35ca36d6762b300d55911a4dc39b1e1 (diff) | |
download | chef-c106a633ef28f5d53cac6bfa64adaddd3aa2f9ca.tar.gz |
remove app_server_support spec filelcg/remove-support-spec
Convert to using TinyServer and remove the duplicated functionality
with the "app_server_support" helper.
The fact that this change hits the knife raw / knife redirection specs
that have so many timeout issues is very likely not a coincidence.
I would bet a small, but not entirely insignificant amount of money that
this makes those timeout issues go away.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared/integration/app_server_support.rb | 39 | ||||
-rw-r--r-- | spec/support/shared/integration/integration_helper.rb | 3 |
2 files changed, 1 insertions, 41 deletions
diff --git a/spec/support/shared/integration/app_server_support.rb b/spec/support/shared/integration/app_server_support.rb deleted file mode 100644 index 317a5a2679..0000000000 --- a/spec/support/shared/integration/app_server_support.rb +++ /dev/null @@ -1,39 +0,0 @@ -# -# Author:: John Keiser (<jkeiser@chef.io>) -# Author:: Ho-Sheng Hsiao (<hosh@chef.io>) -# Copyright:: Copyright 2012-2018, Chef Software Inc. -# License:: Apache License, Version 2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require "rack" -require "stringio" - -module AppServerSupport - def start_app_server(app, port) - server = nil - thread = Thread.new do - Rack::Handler::WEBrick.run(app, - Port: 9018, - AccessLog: [], - Logger: WEBrick::Log.new(StringIO.new, 7)) do |found_server| - server = found_server - end - end - Timeout.timeout(30) do - sleep(0.01) until server && server.status == :Running - end - thread - end -end diff --git a/spec/support/shared/integration/integration_helper.rb b/spec/support/shared/integration/integration_helper.rb index 6c0eca98be..f0dfd1dc43 100644 --- a/spec/support/shared/integration/integration_helper.rb +++ b/spec/support/shared/integration/integration_helper.rb @@ -1,7 +1,7 @@ # # Author:: John Keiser (<jkeiser@chef.io>) # Author:: Ho-Sheng Hsiao (<hosh@chef.io>) -# Copyright:: Copyright 2012-2016, Chef Software Inc. +# Copyright:: Copyright 2012-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,6 @@ require "chef/config" require "chef/json_compat" require "chef/server_api" require "support/shared/integration/knife_support" -require "support/shared/integration/app_server_support" require "cheffish/rspec/chef_run_support" require "spec_helper" |