[Bug 17742] New: Test t/db_dependent/Patrons.t can fail randomly
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Bug ID: 17742 Summary: Test t/db_dependent/Patrons.t can fail randomly Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: josef.moravec@gmail.com QA Contact: gmcharlt@gmail.com Tests on line 75 and 81 can sometimes, the failing line is: is( dt_from_string($b1_new->updated_on), dt_from_string, "borrowers.updated_on should have been set to now on creating" ); And the problem could more often happen on slower machines... We are testing the date and time of updated_on, but creating the test patrons, retrieving tested patron and test itself definitely takes some (short) time... which sometimes can be on the edge of a second and you can see this: # Failed test 'borrowers.updated_on should have been set to now on creating' # at t/db_dependent/Patrons.t line 75. # got: '2016-12-06T20:44:25' # expected: '2016-12-06T20:44:26' and also, the both tests on line 75 and 81 are the same, which is not intended I think... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Josef Moravec <josef.moravec@gmail.com> 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=17742 --- Comment #1 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 58033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58033&action=edit Bug 17742: Fix t/db_dependent/Patrons.t Moves the getting of testing date for updated_on just after the storing the test patron data to make the gap between generating data and now date as short as possible Changes test #7 to the one which was probably originally intended Test plan 1. prove t/db_dependent/Patrons.t 2. read the diff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Chris Kirby <chris.kirby@ilsleypubliclibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58033|0 |1 is obsolete| | --- Comment #2 from Chris Kirby <chris.kirby@ilsleypubliclibrary.org> --- Created attachment 58085 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58085&action=edit Bug 17742: Fix t/db_dependent/Patrons.t Moves the getting of testing date for updated_on just after the storing the test patron data to make the gap between generating data and now date as short as possible Changes test #7 to the one which was probably originally intended Test plan 1. prove t/db_dependent/Patrons.t 2. read the diff Signed-off-by: Chris Kirby <chris.kirby@ilsleypubliclibrary.org> Tests passed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Chris Kirby <chris.kirby@ilsleypubliclibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |chris.kirby@ilsleypubliclib | |rary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Failed QA --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Chris Kirby from comment #2)
Changes test #7 to the one which was probably originally intended
No, the original test was good. We want to check that the updated_on value has been updated when a patron is modified. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 --- Comment #4 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to Jonathan Druart from comment #3)
(In reply to Chris Kirby from comment #2)
Changes test #7 to the one which was probably originally intended
No, the original test was good. We want to check that the updated_on value has been updated when a patron is modified.
But shouldn't it be tested on $b3_new? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Josef Moravec from comment #4)
(In reply to Jonathan Druart from comment #3)
(In reply to Chris Kirby from comment #2)
Changes test #7 to the one which was probably originally intended
No, the original test was good. We want to check that the updated_on value has been updated when a patron is modified.
But shouldn't it be tested on $b3_new?
Yes it should. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58085|0 |1 is obsolete| | --- Comment #6 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 58148 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58148&action=edit Bug 17742: Fix t/db_dependent/Patrons.t Moves the getting of testing date for updated_on just after the storing the test patron data to make the gap between generating data and now date as short as possible Fixes test 7 Use Koha::Database instead of C4::Context->dbh Test plan 1. prove t/db_dependent/Patrons.t 2. read the diff Signed-off-by: Chris Kirby <chris.kirby@ilsleypubliclibrary.org> Tests passed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to Jonathan Druart from comment #3)
(In reply to Chris Kirby from comment #2)
Changes test #7 to the one which was probably originally intended
No, the original test was good. We want to check that the updated_on value has been updated when a patron is modified.
I change the back to original test, fix it (I hope), now it's tested on firstname, instead of surname, which is needed in later test... and maked the tests use Koha::Database instead of C4:Context->dbh; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58148|0 |1 is obsolete| | --- Comment #8 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 58150 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58150&action=edit Bug 17742: Fix t/db_dependent/Patrons.t Moves the getting of testing date for updated_on just after the storing the test patron data to make the gap between generating data and now date as short as possible Fixes test 7 Use Koha::Database instead of C4::Context->dbh Test plan 1. prove t/db_dependent/Patrons.t 2. read the diff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 M. Tompsett <mtompset@hotmail.com> 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=17742 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58150|0 |1 is obsolete| | --- Comment #9 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 58460 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58460&action=edit Bug 17742: Fix t/db_dependent/Patrons.t Moves the getting of testing date for updated_on just after the storing the test patron data to make the gap between generating data and now date as short as possible Fixes test 7 Use Koha::Database instead of C4::Context->dbh Test plan 1. prove t/db_dependent/Patrons.t 2. read the diff NOTE: Only minor improvement could be using test builder to generate the category and branch codes, rather than assume data exists. However, that is beyond scope of this bug. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 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=17742 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58460|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58462 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58462&action=edit Bug 17742: Fix t/db_dependent/Patrons.t Moves the getting of testing date for updated_on just after the storing the test patron data to make the gap between generating data and now date as short as possible Fixes test 7 Use Koha::Database instead of C4::Context->dbh Test plan 1. prove t/db_dependent/Patrons.t 2. read the diff NOTE: Only minor improvement could be using test builder to generate the category and branch codes, rather than assume data exists. However, that is beyond scope of this bug. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58463 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58463&action=edit Bug 17742: Use TestBuilder to create the library and patron category Moreover we do not need to remove the existing issues and patrons Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Josef, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |katrin.fischer@bsz-bw.de --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- These patches have been pushed to 16.11.x and will be in 16.11.02. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #14 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.08 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17742 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