Sha256: 99174a62b354eb17a05fd8422dac8a980983f6577e7f3dc9e14f8aa4a4d6f249

Contents?: true

Size: 1.97 KB

Versions: 79

Compression:

Stored size: 1.97 KB

Contents

# run_in_parallel global and command options

## run_in_parallel global option

The run_in_parallel global option is an array with the following possible values: ['configure', 'install']. It defaults to an empty array `[]`. It can be set in an options file, or overriden by the `BEAKER_RUN_IN_PARALLEL` environment variable. Example:

```console
$ export BEAKER_RUN_IN_PARALLEL=configure,install
```

Including 'configure' causes timesync to execute in parallel (if timesync=true for any host)

Including 'install' causes as much of the puppet install to happen in parallel as possible.

## run_in_parallel command option

The run_in_parallel command option is a boolean value, specifying whether to execute each iteration (usually of hosts) in parallel, or not.  The block_on method is the primary method accepting the run_in_parallel command option, however many methods that call into block_on respect it as well:

- on
- run_block_on
- block_on
- install_puppet_agent_on
- apply_manifest_on
- stop_agent_on
- execute_powershell_script_on

## Using InParallel in your test scripts

In addition to the options, you can use InParallel within your test scripts as well. Examples:

```ruby
include InParallel

test_name('test_test')

# Example 1
hosts.each_in_parallel{ |host|
    # Do something on each host
}

def some_method_call
    return "some_method_call"
end

def some_other_method_call
    return "some_other_method_call"
end

# Example 2
# Runs each method within the block in parallel in a forked process
run_in_parallel{
    @result = some_method_call
    @result_2 = some_other_method_call
}

# results in 'some_method_callsome_other_method_call'
puts @result + @result_2
```

**_Note:_** While you can return a result from a forked process to an instance variable, any values assigned to local variables, or other changes to global state will not persist from the child process to the parent process.

Further documentation on the usage of [InParallel](http://github/puppetlabs/in-parallel/readme.md)

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
beaker-6.5.0 docs/how_to/run_in_parallel.md
beaker-6.4.1 docs/how_to/run_in_parallel.md
beaker-6.4.0 docs/how_to/run_in_parallel.md
beaker-6.3.0 docs/how_to/run_in_parallel.md
beaker-6.2.0 docs/how_to/run_in_parallel.md
beaker-6.1.0 docs/how_to/run_in_parallel.md
beaker-5.8.1 docs/how_to/run_in_parallel.md
beaker-4.42.0 docs/how_to/run_in_parallel.md
beaker-5.8.0 docs/how_to/run_in_parallel.md
beaker-5.7.0 docs/how_to/run_in_parallel.md
beaker-4.41.2 docs/how_to/run_in_parallel.md
beaker-4.41.1 docs/how_to/run_in_parallel.md
beaker-5.6.0 docs/how_to/run_in_parallel.md
beaker-4.41.0 docs/how_to/run_in_parallel.md
beaker-5.5.0 docs/how_to/run_in_parallel.md
beaker-5.4.0 docs/how_to/run_in_parallel.md
beaker-5.3.1 docs/how_to/run_in_parallel.md
beaker-4.40.2 docs/how_to/run_in_parallel.md
beaker-5.3.0 docs/how_to/run_in_parallel.md
beaker-4.40.1 docs/how_to/run_in_parallel.md