Skip to content

erp5_core_test: Make testWorkflowHistoryList.TestDedup stable.

Vincent Pelletier requested to merge vpelletier/erp5:stabilise_TestDedup into master

The precise number of entries in a bucket depend on an estimation of the size of a pickle. The pickled data contains DateTime objects, making an equality test brittle:

  • DateTime's timezones are stored as strings (ex: 'GMT') whose length depend on Zope's timezone, which is variable
  • DateTime's time is stored as a floating-point value represented as a string whose length depends on the number of units and decimals are necessary to represent its value, both being variable (one based on when the test was run, the other based on clock precision and exact test execution timing)

Instead, restore the originally-considered-acceptable boundary (24) and verify that the generated value is greater or equal to it. If 24 is considered too small to be acceptable, then it is a decision independent from the present change.

EDIT: some references:

  • 9612e94d
  • discussion on !1378 about this test (where the original value was replaced)

/cc @jerome @jm @arnau

Edited by Vincent Pelletier

Merge request reports