Pabot (Robot Framework Parallel Runner)
Pabot is a parallel test runner for Robot Framework. It enables splitting test execution across multiple processes, thereby significantly reducing overall test execution time. It is actively maintained with frequent releases, offering features for enhanced test execution control and resource management.
Warnings
- breaking Pabot 5.0.0 introduced significant internal changes, particularly in subprocess handling, artifact management, and ordering logic. Users with heavily customized execution workflows or older Robot Framework versions may experience unexpected behavior.
- gotcha When running tests in parallel, shared resources (e.g., files, databases, specific test accounts) can lead to conflicts or data corruption. PabotLib keywords like 'Acquire Lock' and 'Release Lock' are essential for managing access to such resources.
- gotcha Pabot by default splits execution at the 'suite level.' If your goal is to parallelize individual test cases within a single suite, you must explicitly use the '--testlevelsplit' option. Not using this option when desired can lead to less effective parallelization.
- gotcha A `KeyError: 'ordering'` could occur when using the `--chunk` option in conjunction with an ordering file. This specific bug was fixed in Pabot 5.2.2.
- gotcha There have been reported compatibility issues between Pabot and Robot Framework 7.0, particularly concerning the cumulative behavior of `--include` arguments, which could lead to unexpected test execution (e.g., tests running multiple times). While patched in later Pabot versions, this highlights the need for careful version alignment.
Install
-
pip install robotframework-pabot==5.2.2 -
pip install -U robotframework-pabot -
pip install -U robotframework-pabot[stacktrace]
Imports
- PabotLib
Library pabot.PabotLib
Quickstart
mkdir tests
cat << EOF > tests/my_suite.robot
*** Settings ***
Library OperatingSystem
*** Test Cases ***
Example Test 1
Log To Console Running Test 1
Sleep 1s
Example Test 2
Log To Console Running Test 2
Sleep 2s
Example Test 3
Log To Console Running Test 3
Sleep 1s
EOF
pabot tests/