Bug 11470 - Circulation_transfers.t can fail, spuriously
Summary: Circulation_transfers.t can fail, spuriously
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Chris Cormack
QA Contact: Galen Charlton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-02 18:01 UTC by Galen Charlton
Modified: 2015-06-04 23:23 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11470: fix occassional spurious test failure in Circulation_transfers.t (2.66 KB, patch)
2014-01-02 18:06 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 11470: fix occassional spurious test failure in Circulation_transfers.t (2.71 KB, patch)
2014-01-05 00:46 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED QA] Bug 11470: fix occassional spurious test failure in Circulation_transfers.t (2.80 KB, patch)
2014-01-05 21:10 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 11470: fix occassional spurious test failure in Circulation_transfers.t (2.80 KB, patch)
2014-01-05 21:10 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2014-01-02 18:01:58 UTC
Circulation_transfers.t creates some branch transfers, then compares them with expected values.  However, some of the tests can fail if enough time happens to pass between the creation of the transfers and the comparison, making the datesent values different.
Comment 1 Galen Charlton 2014-01-02 18:06:08 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-01-05 00:46:28 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-01-05 21:10:12 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2014-01-05 21:10:40 UTC
Created attachment 23909 [details] [review]
[PASSED QA] Bug 11470: fix occassional spurious test failure in Circulation_transfers.t

This patch makes Circulation_transfers.t no longer be sensitive to
the exact time it runs, avoiding spurious test failures due
to datesent being a second off between the creation of the test
transfer and the comparison.

To test:

[1] To simulate the failure, add a "sleep(2);" after the
    "#Test GetTransfers" comment and run
    prove -v t/db_dependent/Circulation_transfers.t
[2] Remove the sleep and apply the patch.
[3] Verify that prove -v t/db_dependent/Circulation_transfers.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.
Comment 5 Galen Charlton 2014-01-06 05:51:35 UTC
Pushed to master.
Comment 6 Fridolin Somers 2014-02-18 07:51:12 UTC
Patch pushed to 3.14.x, will be in 3.14.4.