Commit 0eca529a authored by Jérome Perrin's avatar Jérome Perrin

core_test: increase expected value testWorkflowHistoryList.TestDedup

After df85ef46 (ERP5Workflow: DC Workflows are now ERP5 objects (!1378).,
2020-11-18) we increased the expected value from 24 to 36, because it
was just different with new workflow implementation and what was important
is to have large buckets.

After that, the test was flaky and eventually we changed the assertion
from checking that the value equal the expected value to checking that
it's larger to checking that it's larger to a satisfying value and we
used the initial 24 for satisfying value.

A large value here means the bucket contain many items, which happens
when the pickle size is small

We now understand that pickle are short when the pickler was able to
deduplicate some strings because they were the same instances (as
compared by `is` operator). Note that this deduplication happens before
the one operated by Products.ERP5Type.Workflow.dedupStrings after bucket
rotation, it's the "normal" deduplication from pickle happening when
element are added to list.

Because it's a good thing for disk usage to have small pickles, we raise
our expectation and increase the expected minimal value to be 30.
parent 60459cc6
......@@ -225,5 +225,5 @@ class TestDedup(ERP5TypeTestCase):
new_obj_length, = deduped # pylint: disable=unbalanced-tuple-unpacking
# The exact boundary does not matter much, but it should be greater than
# some arbitrary value considered satisfying.
self.assertGreaterEqual(new_obj_length, 24)
self.assertGreaterEqual(new_obj_length, 30)
self.assertEqual(len(list(whl)), new_obj_length + 1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment