Bug 23994

Summary: AdditionalFields.t is failing randomly (U18)
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lucas, martin.renvoize, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00, 19.05.12
Bug Depends on:    
Bug Blocks: 25551    
Attachments: Bug 23994: Fix random failure from AdditionalFields.t (U18)

Description Jonathan Druart 2019-11-08 09:27:41 UTC
t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t .. 1/12 
#   Failed test '->additional_field_values should return the correct values'
#   at t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t line 82.
#     Structures begin differing at:
#          $got->[0]{value} = 'bar value for basket2'
#     $expected->[0]{value} = 'foo value for basket2'
# Looks like you failed 1 test of 12.

We do not really know why, but the values are not returned in the order they are stored in DB. Fixing this random failure for now at test level.
Comment 1 Jonathan Druart 2019-11-08 09:29:00 UTC
Created attachment 95187 [details] [review]
Bug 23994: Fix random failure from AdditionalFields.t (U18)

t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t .. 1/12
 #   Failed test '->additional_field_values should return the correct values'
 #   at t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t line 82.
 #     Structures begin differing at:
 #          $got->[0]{value} = 'bar value for basket2'
 #     $expected->[0]{value} = 'foo value for basket2'
 # Looks like you failed 1 test of 12.

We do not really know why, but the values are not returned in the order they are stored in DB. Fixing this random failure for now at test level.
Comment 2 Martin Renvoize 2019-11-08 09:34:32 UTC
As discussed on IRC, this works and gets the tests passing again... no idea why it returns differently on U18 but the order is unimportant in the context anyway.  Passing QA and Pushing.
Comment 3 Lucas Gass 2020-01-09 22:33:29 UTC
I cannot make this fail in 19.05.x, do we need it in that version?
Comment 4 Jonathan Druart 2020-01-10 08:35:17 UTC
(In reply to Lucas Gass from comment #3)
> I cannot make this fail in 19.05.x, do we need it in that version?

Yes, it should fail on U18 as well.
Comment 5 Victor Grousset/tuxayo 2020-06-05 20:41:40 UTC
(In reply to Lucas Gass from comment #3)
> I cannot make this fail in 19.05.x, do we need it in that version?

I have this failing locally often (whereas it seems ok in the CI), it must depend a lot of the machine.

So need in 19.05.x is confirmed.
Comment 6 Victor Grousset/tuxayo 2020-06-06 03:33:31 UTC
Wait it's already in 19.11 since a long time. Great I can backport it :)
Comment 7 Victor Grousset/tuxayo 2020-06-08 20:34:35 UTC
Backported to 19.05.x branch for 19.05.12