Skip to content

[18.0] product_main_supplierinfo : tests are failing from 10pm to midnight #2260

@metaminux

Description

@metaminux

Module

product_main_supplierinfo

Describe the bug

A test is failing when executed between 10pm and midnight UTC

This is the trace extracted from the log for #2250 :

2026-04-15 22:19:28,789 398 INFO odoo odoo.modules.loading: Loading module product_main_supplierinfo (145/199) 
2026-04-15 22:19:29,081 398 INFO odoo odoo.modules.registry: module product_main_supplierinfo: creating or updating database tables 
2026-04-15 22:19:29,336 398 INFO odoo odoo.modules.loading: loading product_main_supplierinfo/views/product_product.xml 
2026-04-15 22:19:29,920 398 INFO odoo odoo.addons.product_main_supplierinfo.tests.test_product_main_supplier: Starting TestProductMainSupplierInfo.test_main_seller_1 ... 
2026-04-15 22:19:29,943 398 INFO odoo odoo.addons.product_main_supplierinfo.tests.test_product_main_supplier: Starting TestProductMainSupplierInfo.test_main_seller_2 ... 
2026-04-15 22:19:29,964 398 INFO odoo odoo.addons.product_main_supplierinfo.tests.test_product_main_supplier: Starting TestProductMainSupplierInfo.test_main_seller_3 ... 
2026-04-15 22:19:29,972 398 INFO odoo odoo.addons.product_main_supplierinfo.tests.test_product_main_supplier: ====================================================================== 
2026-04-15 22:19:29,972 398 ERROR odoo odoo.addons.product_main_supplierinfo.tests.test_product_main_supplier: FAIL: TestProductMainSupplierInfo.test_main_seller_3
Traceback (most recent call last):
  File "/__w/product-attribute/product-attribute/product_main_supplierinfo/tests/test_product_main_supplier.py", line 112, in test_main_seller_3
    self.assertEqual(self.product.main_seller_id, self.seller_2bis)
AssertionError: product.supplierinfo(1,) != product.supplierinfo(3,)
 
2026-04-15 22:19:29,982 398 INFO odoo odoo.addons.product_main_supplierinfo.tests.test_product_main_supplier: Starting TestProductMainSupplierInfo.test_main_seller_4 ... 
2026-04-15 22:19:30,386 398 INFO odoo odoo.addons.base.models.ir_attachment: filestore gc 0 checked, 0 removed 
2026-04-15 22:19:30,456 398 INFO odoo odoo.modules.loading: Module product_main_supplierinfo loaded in 1.67s (incl. 0.99s test), 101 queries (+650 test, +101 other) 
2026-04-15 22:19:30,456 398 ERROR odoo odoo.modules.loading: Module product_main_supplierinfo: 1 failures, 0 errors of 4 tests 

See https://github.com/OCA/product-attribute/actions/runs/24481150014/job/71545725417?pr=2250#step:8:972 for full log while available

To Reproduce

Affected versions: 18.0 at least

Steps to reproduce the behavior:

  1. push a commit for any module between 10pm and midnight UTC

Expected behavior
All tests are OK

Additional context
I suppose this is due to timezone (GMT+2) as tests are relying on today, tomorrow and yesterday but sometimes using context_today.
I also suppose this could be fixed using freeze_time as in product_supplierinfo_import/tests/test_product_supplierinfo_import.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions