You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite the fact SoloRunner is the preferred runner for Chef Server / Chef Zero users since version 5.10 (2016-09-14), Chefspec is starting a ZeroServer at the begining of the rspec suite!
This seems not a critical issue but it may triggers error in CI environment as ZeroServerreserves one port from the range 8889..8899 which can prevent other tests to run properly.
e.g. you can't run 11 chefspecs suites in concurrency! 😿
Expected behavior
Chefspec should not setup a ChefZero server when you do not use ServerRunner!
Disabling ChefZero server should not require any extra configuration
Proposed solutions
As I personally think not starting a ChefZero server should be the default, I will not sugest a solution based on a configuration setting.
Currently I can think of 3 solutions:
do not require the server_runner.rb file by default, forcing people to require it when they want to instanciate the runner.
➖ This is obviously a breaking change compared to current state,
➕ This solution has the benefits to just remove one require line :
creates a new "require entry_point" to explicitely exclude the server_runner require, something like require 'chefspec/without_server_runner'
➖ This needs to change a bit the require list in a non standard way
➖ With default require 'chefspec' there is still a ZeroServer spawned
➕ This is very explict and impact only people that does not want the ZeroServer
Delay the configuration (setup! but also reset! & teardown!) of the ZeroServer at first ServerRunner initialization
➖ This might slow down the first test a bit and have other impact that I do not foresee 🤷🏻♂️
➕ This only impacts ServerRunner users
➕ SoloRunner users are not "impacted" anymore by ServerRunner's features
I prefere solution #3, although as SoloRunner user I would also accept solution #2.
As I'm not using ServerRunner much I would not be annoyed by solution #1 but I can understand that introducing a breaking change for such a minimal issue is not great 🤷🏻♂️
Should you have other idea please share them, I'm OK to send a PR with any fix going toward described Expected behavior
The text was updated successfully, but these errors were encountered:
The legacy chef-solo mode should really be removed from the chef-client codebase entirely and chefspec should be switched to ZeroServer always.
The perf issues with the cookbook_versions endpoint go away in a policyfile world where that endpoint is never hit and/or the perf hit of the cookbook_versions endpoint in the chef-zero server should get addressed.
Thank you @lamont-granquist for this answer.
I was not expecting that, but if Chef's direction is to completely get rid of the chef-solo mode I understand.
On the long run I'll have to find a nice way to configure the ZeroServer port range in my CI!
Have you any ETA on when chef-solo mode will be removed?
In the meantime would you accept a PR implementing the third option I proposed?
Issue description
Despite the fact SoloRunner is the preferred runner for Chef Server / Chef Zero users since version 5.10 (2016-09-14), Chefspec is starting a ZeroServer at the begining of the rspec suite!
This is due to the fact
require 'chefspec'
triggers the require of most its features including the ServerRunner class which requires the ZeroServer class which automatically configures abefore(:suite)
hook .This seems not a critical issue but it may triggers error in CI environment as
ZeroServer
reserves one port from the range 8889..8899 which can prevent other tests to run properly.e.g. you can't run 11 chefspecs suites in concurrency! 😿
Expected behavior
Proposed solutions
As I personally think not starting a ChefZero server should be the default, I will not sugest a solution based on a configuration setting.
Currently I can think of 3 solutions:
server_runner.rb
file by default, forcing people to require it when they want to instanciate the runner.➖ This is obviously a breaking change compared to current state,
➕ This solution has the benefits to just remove one require line :
require 'chefspec/without_server_runner'
➖ This needs to change a bit the require list in a non standard way
➖ With default
require 'chefspec'
there is still aZeroServer
spawned➕ This is very explict and impact only people that does not want the
ZeroServer
setup!
but alsoreset!
&teardown!
) of theZeroServer
at firstServerRunner
initialization➖ This might slow down the first test a bit and have other impact that I do not foresee 🤷🏻♂️
➕ This only impacts ServerRunner users
➕ SoloRunner users are not "impacted" anymore by ServerRunner's features
I prefere solution
#3
, although as SoloRunner user I would also accept solution#2
.As I'm not using ServerRunner much I would not be annoyed by solution
#1
but I can understand that introducing a breaking change for such a minimal issue is not great 🤷🏻♂️Should you have other idea please share them, I'm OK to send a PR with any fix going toward described
Expected behavior
The text was updated successfully, but these errors were encountered: