OCA / crm

Odoo CRM, Mail & Newsletter advanced features
GNU Affero General Public License v3.0
152 stars 394 forks source link

crm_salesperson_planner: flaky test #589

Closed yajo closed 1 month ago

yajo commented 1 month ago

Module

crm_salesperson_planner

Describe the bug

The module tests started failing recently with:

2024-07-23 09:48:39,728 315 INFO odoo odoo.addons.crm_salesperson_planner.tests.test_crm_salesperson_planner_visit_template: Starting TestCrmSalespersonPlannerVisitTemplate.test_05_repeat_weeks ... 
2024-07-23 09:48:39,735 315 INFO odoo odoo.addons.crm_salesperson_planner.tests.test_crm_salesperson_planner_visit_template: ====================================================================== 
2024-07-23 09:48:39,735 315 ERROR odoo odoo.addons.crm_salesperson_planner.tests.test_crm_salesperson_planner_visit_template: ERROR: TestCrmSalespersonPlannerVisitTemplate.test_05_repeat_weeks
Traceback (most recent call last):
  File "/__w/crm/crm/crm_salesperson_planner/tests/test_crm_salesperson_planner_visit_template.py", line 214, in test_05_repeat_weeks
    create_item.create_visits()
  File "/__w/crm/crm/crm_salesperson_planner/wizards/crm_salesperson_planner_visit_template_create.py", line 31, in create_visits
    raise ValidationError(_("The date can't be earlier than today"))
odoo.exceptions.ValidationError: The date can't be earlier than today

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior: Just see the flaky test in action in https://github.com/OCA/crm/actions/runs/10056645027/job/27795901288?pr=577 (for #577).

Expected behavior Test without false negatives.

Additional context Check guide to avoid date-sensitive flaky tests: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#avoid-dynamic-dates

We don't use the module personally but it's blocking our PRs. The flaky test was added in https://github.com/OCA/crm/pull/559. Could you please take a look @victoralmau? Thanks!

yajo commented 1 month ago

Thank you!