[Koha-bugs] [Bug 28632] patrons.t fragile on slow boxes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 25 17:30:50 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28632

--- Comment #1 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 122447
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122447&action=edit
Bug 28632: Make patrons.t robust in terms of elapsed time between tests

This patch changes the tests so they don't try to compare updated_on
from many tests ago, so it is less fragile.

I added a warn on the unmatched fields for convenience.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> SUCCESS: Tests pass!
2. Make your computer very slow
3. Repeat 1
=> FAIL: You get things like:
t/db_dependent/api/v1/patrons.t .. 3/7
        #   Failed test 'Returned patron from update matches expected'
        #   at t/db_dependent/api/v1/patrons.t line 513.
        #     Structures begin differing at:
        #          $got->{updated_on} = '2021-06-25T14:26:20+00:00'
        #     $expected->{updated_on} = '2021-06-25T14:26:19+00:00'
        # Looks like you failed 1 test of 42.
4. Apply this patch
5. Repeat 1
=> SUCCESS: Tests pass again!
6. Sign off :-D

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list