Skip to content

Commit

Permalink
turn off parallel vbox when run on Windows hosts
Browse files Browse the repository at this point in the history
The fix for running create and destroy in parallel on Virtualbox
exacerbates and existing problem with deeply nested, long directory
names that trips on Windows' 256 character path limit. Disabling
parallel runs on Windows hosts until such time as maybe UNC paths are
tested.

Signed-off-by: Robb Kidd <[email protected]>
  • Loading branch information
robbkidd committed Aug 22, 2017
1 parent 4f579b5 commit 9691e9b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/kitchen/driver/vagrant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class Vagrant < Kitchen::Driver::Base

default_config :cachier, nil

# no_parallel_for :create, :destroy
# disable parallel create/destroy on Windows hosts because it exacerbates an existing
# path length problem
no_parallel_for :create, :destroy if RbConfig::CONFIG["host_os"] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/

# Creates a Vagrant VM instance.
#
Expand Down Expand Up @@ -378,7 +380,7 @@ def render_template
# @see Kitchen::ShellOut.run_command
# @api private
def run(cmd, options = {})
if vagrant_root && config[:provider] == "virtualbox"
if !windows_host? && vagrant_root && config[:provider] == "virtualbox"
require "digest"
options[:environment] = {} if options[:environment].nil?
options[:environment]["VBOX_IPC_SOCKETID"] =
Expand Down Expand Up @@ -448,7 +450,7 @@ def run_command(cmd, options = {})
#
# @api private
def run_pre_create_command
if vagrant_root && config[:provider] == "virtualbox"
if !windows_host? && vagrant_root && config[:provider] == "virtualbox"
run("vboxmanage setproperty machinefolder #{vagrant_root}",
:cwd => config[:kitchen_root])
debug("Set VirtualBox machinefolder to #{vagrant_root}")
Expand Down Expand Up @@ -564,7 +566,7 @@ def verify_winrm_plugin
#
# @api private
def windows_host?
RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
RbConfig::CONFIG["host_os"] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
end

# @return [true,false] whether or not the vagrant-winrm plugin is
Expand Down

0 comments on commit 9691e9b

Please sign in to comment.