fix(venom): user executors performance issues #831
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fix about performance issues we encountered running testsuites with many User Defined Executors (UDE). Issue 826 was opened regarding this problem.
UDEs
Previous behavior
lib
folder (let's call themcreateUser
andcreateProduct
), butcreateUser.yaml
is not valid YAML. When running a test suite that only uses thecreateProduct
UDE, you get the following error message:$ venom run mytestsuite.yml executor "createProduct" is not implemented
even though
createProduct
is valid. This occurs because the parsing ofcreateUser
failed (even if it is not used in the test suite).libDir
configuration option to the same value as the default one (lib/
), each file of the directory will be loaded 2 times at each call ofregisterUserExecutors()
New behaviour
executor
andsteps
are present, we load the raw file in memory and we perform a duplication check:Improvement measurement
I tested this fix on a collection of test suites totalling around 700 test cases and 120 UDEs, with some of them layered (UDE calling another UDE). Runtime has been divided by a factor of 3 (from around 35min down to around 12min)
Additional performance enhancement
exec
executor reads stdout and stderr. For exemple when loading a file into a variable with exec:With 100k lines in the file, this test step used to take more than a minute. This lowers it down to only a couple ms.
maps.Clone()
to clone a map