How to expect reboot with chef 13

Chef 13 introduced new reboot behavior as covered in this RFC

In the latest versions of test kitchen, a reboot causes test kitchen to exit unsucessfully

Chef Development Kit Version: 1.3.43
chef-client version: 12.19.36
delivery version: master (dd319aa632c2f550c92a2172b9d1226478fea997)
berks version: 5.6.4
kitchen version: 1.16.0

How can test kitchen be configured to continue after a reboot in chef 13?

     Converging 1 resources
       Recipe: nd-ad-join::default
         * domain_join[default] action join
           * reboot[Restart Computer] action nothing (skipped due to action :nothing)
           * registry_key[warning] action nothing (skipped due to action :nothing)
           * windows_task[chef ad-join] action create

           * registry_key[warning] action create (skipped due to only_if)
           * powershell_script[ad-join] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/vagrant/AppData/Local/Temp/chef-script20170419-2296-jd08h1.ps1"
           * reboot[Restart Computer] action reboot_now[2017-04-19T16:41:53+00:00] WARN: Rebooting system immediately, requested by 'Restart Computer'


             Running handlers:
             Running handlers complete
             Chef Client finished, 2/5 resources updated in 58 seconds
       [2017-04-19T16:41:54+00:00] WARN: Rebooting server at a recipe's request. Details: {:delay_mins=>0, :reason=>"Reboot by Chef", :timestamp=>2017-04-19 16:41:53 +0000, :requested_by=>"Restart Computer"}

             Running handlers:
       [2017-04-19T16:41:54+00:00] ERROR: Running exception handlers
             Running handlers complete
       [2017-04-19T16:41:54+00:00] ERROR: Exception handlers complete
             Chef Client failed. 2 resources updated in 58 seconds
       [2017-04-19T16:41:54+00:00] FATAL: Stacktrace dumped to C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
       [2017-04-19T16:41:54+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2017-04-19T16:41:54+00:00] FATAL: Chef::Exceptions::Reboot: Rebooting server at a recipe's request. Details: {:delay_mins=>0, :reason=>"Reboot by Chef", :timestamp=>2017-04-19 16:41:53 +0000, :requested_by=>"Restart Computer"}
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-netdocuments-windows-2012r2>.  Please see .kitchen/logs/default-netdocuments-windows-2012r2.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Hello @spuder

Has this functionality changed at all?

The reboot resource used to be in the windows cookbook and was dealt with by a handler. There is now a reboot resource is core Chef with slightly different settings which can cause an immediate reboot.

The announcement for handling reboot between kitchen runs is Test-Kitchen 1.10.0 Released

I have a demo cookbook on my Github which appears to work with Chef 13.0.118 https://github.com/chrisgit/test_kitchen-multiboot

What is the new behaviour? Which version of ChefDK are you using?

@spuder @chris_sullivan - The reboot exit code that was optional in Chef 12 is the default behavior in Chef 13. Test-Kitchen still requires you to define exit codes to retry upon (though maybe we could set that by default in the chef provisioners for reboot and chef client upgrades now, but that would be an update to test-kitchen).

The exit does throw an error as you are stopping the run exceptionally.