mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
CHEF-3833 Added delay for InSpec parallel status reporter (#6993)
* Added delay in status reporter for inspec-parallel for clear reporting Signed-off-by: Nik08 <nikita.mathur@progress.com> * Made chef-licensing warning silent between parallel runs Signed-off-by: Nik08 <nikita.mathur@progress.com> * Code review changes for setting output config Signed-off-by: Nik08 <nikita.mathur@progress.com> * As a safe measure added logic to reset output stream Signed-off-by: Nik08 <nikita.mathur@progress.com> --------- Signed-off-by: Nik08 <nikita.mathur@progress.com>
This commit is contained in:
parent
9ab6a463d0
commit
c83733bf9e
2 changed files with 6 additions and 0 deletions
|
@ -22,7 +22,10 @@ module InspecPlugins
|
|||
|
||||
def run
|
||||
initiate_background_run if run_in_background # running a process as daemon changes parent process pid
|
||||
original_stdout_stream = ChefLicensing::Config.output
|
||||
until invocations.empty? && @child_tracker.empty?
|
||||
# Changing output to STDERR to avoid the output interruption between runs
|
||||
ChefLicensing::Config.output = STDERR
|
||||
while should_start_more_jobs?
|
||||
if Inspec.locally_windows?
|
||||
spawn_another_process
|
||||
|
@ -35,6 +38,8 @@ module InspecPlugins
|
|||
cleanup_child_processes
|
||||
sleep 0.1
|
||||
end
|
||||
# Reset output to the original STDOUT stream as a safe measure.
|
||||
ChefLicensing::Config.output = original_stdout_stream
|
||||
|
||||
# Requires renaming operations on windows only
|
||||
# Do Rename and delete operations after all child processes have exited successfully
|
||||
|
|
|
@ -44,6 +44,7 @@ module InspecPlugins::Parallelism
|
|||
status_by_pid[pid][:last_control] = title
|
||||
status_by_pid[pid][:last_status] = status
|
||||
|
||||
sleep 0.5
|
||||
paint
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue