Tryton - Issues

 

Issue6514

Title Tests broken by sqlite 3.16.0
Priority bug Status resolved
Superseder Nosy List ced, reviewbot, roundup-bot
Type crash Components trytond
Assigned To ced Keywords review
Reviews 34131002
View: 34131002

Created on 2017-05-18.16:08:57 by ced, last changed by roundup-bot.

Messages
New changeset 2d01c6cee873 by Cédric Krier in branch '4.4':
Remove duplicate ids when searching parent menu
http://hg.tryton.org/trytond/rev/2d01c6cee873

New changeset 356a2fcc9007 by Cédric Krier in branch '4.2':
Remove duplicate ids when searching parent menu
http://hg.tryton.org/trytond/rev/356a2fcc9007

New changeset 9610ed0d3840 by Cédric Krier in branch '4.0':
Remove duplicate ids when searching parent menu
http://hg.tryton.org/trytond/rev/9610ed0d3840

New changeset 91d0587d0a76 by Cédric Krier in branch '3.8':
Remove duplicate ids when searching parent menu
http://hg.tryton.org/trytond/rev/91d0587d0a76

New changeset a036e3d12301 by Cédric Krier in branch '3.6':
Remove duplicate ids when searching parent menu
http://hg.tryton.org/trytond/rev/a036e3d12301
New changeset 645540e28c2b by Cédric Krier in branch 'default':
Remove duplicate ids when searching parent menu
http://hg.tryton.org/trytond/rev/645540e28c2b
review34131002 updated at https://codereview.tryton.org/34131002/#ps1
msg33703 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-05-18.16:08:56
The test_menu_action fails when running with sqlite >=3.16.0:

ERROR: test_menu_action (trytond.modules.stock.tests.test_stock.StockTestCase)
Test that menu actions are accessible to menu's group
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/tests/test_tryton.py", line 168, in wrapper
    result = func(*args, **kwargs)
  File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/tests/test_tryton.py", line 333, in test_menu_action
    if not menu.action_keywords:
  File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/model/modelstorage.py", line 1369, in __getattr__
    read_data = self.read(list(ids), ffields.keys())
  File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/model/modelsql.py", line 759, in read
    getter_result = field.get(ids, cls, fname, values=result)
  File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/model/fields/one2many.py", line 116, in get
    origin_id = getattr(target, self.field).id
AttributeError: 'NoneType' object has no attribute 'id'


The issue is a bug in sqlite: https://www.sqlite.org/src/tktview?name=61fe97454c
But there are any fixed release yet.

Indeed the issue is particularly exposed by the Menu.search method which construct a parent search using a list that has great chances to have duplicates ids.
I think we should fix the trytond code because it will not create false positive test failure and also because it will improve any way the performance by removing duplicated ids (and also the length of the list could become too long for the SQL query).
History
Date User Action Args
2017-06-13 09:59:21roundup-botsetmessages: + msg34032
2017-05-30 22:03:36roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg33811
2017-05-18 16:40:31reviewbotsetnosy: + reviewbot
messages: + msg33704
2017-05-18 16:18:51cedsetstatus: in-progress -> testing
reviews: 34131002
keyword: + review
2017-05-18 16:08:57cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)