Stabilise benchmarks performance
Sometimes, not always, KeyError happens many times in DeliveryBuilder_selectConfirmedDeliveryList
script during benchmark tests.
That can happen when three Zope transactions run like the following order in parallel :
* Node1: create a Sale Packing List
* Node2: build activity started
* Node1: transaction committed
* Node3: index activity started
* Node3: MariaDB transaction committed
* Node2: portal_catalog() finds a row
Here, Node2 cannot find the Sale Packing List, because Node2 transaction started before the commit of Node1, thus brain.getObject() raises an KeyError.
It can happen elsewhere and it is normally not a big issue, as the activity will be retried.
You can check if you have such case by grepping activity nodes log files like $ xzgrep -aB3 "zsqlbrain.py, .*in getObject$" srv/backup/logrotate/zope-*-event.log-*.xz
.
But for benchmarks (see software/erp5/test/test/benchmarks.py in SlapOS repository), the performance differs much if such KeyError happens a lot or not. This merge request is to ignore possible KeyError in benchmarks so that we can get stable results.
Here is the comparison with / without this merge request's changes when KeyError happen around 1000 times.
- total duration with KeyError: 9734.35 seconds
- total duration without KeyError: 7774.58 seconds