[Bug 19463] New: TestBuilder.t is failing randomly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Bug ID: 19463 Summary: TestBuilder.t is failing randomly Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Violation of unique constraint in Branch at /kohadevbox/koha/t/lib/TestBuilder.pm line 233. # Failed test 'Testing Koha::Old::Checkouts' # at t/db_dependent/TestBuilder.t line 389. # got: '' # expected: 'Koha::Old::Checkout' # Looks like you failed 1 test of 67. # Failed test 'Test all classes' # at t/db_dependent/TestBuilder.t line 391. # Looks like you failed 1 test of 6. # Failed test 'build_object() tests' # at t/db_dependent/TestBuilder.t line 392. # Looks like you failed 1 test of 12. [07:55:06] t/db_dependent/TestBuilder.t ................................... I guess it tries to generate twice the same value branchcode (unlucky!) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #0)
Violation of unique constraint in Branch at /kohadevbox/koha/t/lib/TestBuilder.pm line 233.
I guess it tries to generate twice the same value branchcode (unlucky!)
It tries three times now. Random is not always that random.. Normally, the two additional tries are sufficient, but I have seen it happen too. We could increase that number? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- That would mean we have too many objects created then... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Violation of unique constraint in Category at /kohadevbox/koha/t/lib/TestBuilder.pm line 240. # Failed test 'Testing Koha::Ratings' # at t/db_dependent/TestBuilder.t line 390. # got: '' # expected: 'Koha::Rating' # Looks like you failed 1 test of 70. # Failed test 'Test all classes' # at t/db_dependent/TestBuilder.t line 392. # Looks like you failed 1 test of 6. # Failed test 'build_object() tests' # at t/db_dependent/TestBuilder.t line 393. # Looks like you failed 1 test of 13. [15:07:54] t/db_dependent/TestBuilder.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68217&action=edit Bug 19463: Reduce the chance to have TestBuilder generate twice the same value When an id is generated by TestBuilder (branchcode for instance) and the size of the generated string is 1, we have too many chances to get "Violation of unique constraint in Branch". This patch will enforce the size of the string to be > 1 and the number of tries to get a different strings will be 5 (instead of 3). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|chris@bigballofwax.co.nz |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68217|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 68218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68218&action=edit Bug 19463: Reduce the chance to have TestBuilder generate twice the same value When an id is generated by TestBuilder (branchcode for instance) and the size of the generated string is 1, we have too many chances to get "Violation of unique constraint in Branch". This patch increases the number of retries to 5. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Amended to make room for follow-up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 68219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68219&action=edit Bug 19463: Additional changes to gen_text Use Bytes::Random::Secure instead of perl rand. Return a string from 50 to 100% of $size. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Thanks Marcel! Pushed to master for 17.11. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 68244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68244&action=edit Bug 19463: (Follow-up) Cosmetic changes String::Random version 0.26 (on Jessie) does not yet support the rand_gen parameter (0.27 does, newest is 0.29 on CPAN now). So alt_rand is only used in determining the size on Jessie. That might be enough though. Adding a documention line in this regard. Removing the obsolete max parameter. Note: I timed alt_rand for the creation of a new Bytes::Random::Secure object each time. But each call is about 0.1 milliseconds. So that should be fine. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19463 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25551 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25551 [Bug 25551] [OMNIBUS] Some tests are failing randomly -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org