Bug 38474 - t/db_dependent/Letters.t can fail randomly
Summary: t/db_dependent/Letters.t can fail randomly
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-18 15:29 UTC by Katrin Fischer
Modified: 2025-02-13 14:32 UTC (History)
1 user (show)

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


Attachments
Bug 38474: Prevent Letters.t to fail on slow server (1.61 KB, patch)
2025-02-10 11:59 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2024-11-18 15:29:45 UTC
17:00:43 koha_1       | #   Failed test 'Time status changed equals time queued when created in message_queue table'
17:00:43 koha_1       | #   at t/db_dependent/Letters.t line 156.
17:00:43 koha_1       | #          got: '2024-11-15 16:00:00'
17:00:43 koha_1       | #     expected: '2024-11-15 15:59:59'
17:00:43 koha_1       | # Looks like you failed 1 test of 103.
17:00:43 koha_1       | [16:00:09] t/db_dependent/Letters.t .................................................... 

It looks like it took a little longer than expected maybe and the test fails because of it. If this is the issue, we could make it a little more robust.
Comment 1 Jonathan Druart 2024-11-18 15:33:47 UTC
It should use t::lib::Dates::compare
Comment 2 Jonathan Druart 2025-02-10 11:56:37 UTC
Again Koha_Main_U24/214

18:30:25 koha_1       | #   Failed test 'Time status changed equals time queued when created in message_queue table'
18:30:25 koha_1       | #   at t/db_dependent/Letters.t line 156.
18:30:25 koha_1       | #          got: '2025-02-05 17:27:07'
18:30:25 koha_1       | #     expected: '2025-02-05 17:27:06'
18:30:25 koha_1       | # Looks like you failed 1 test of 104.
18:30:25 koha_1       | [17:27:13] t/db_dependent/Letters.t
Comment 3 Jonathan Druart 2025-02-10 11:59:19 UTC
Created attachment 177676 [details] [review]
Bug 38474: Prevent Letters.t to fail on slow server

We must always use t::lib::Dates::compare when we compare dates in
tests.
Comment 4 Katrin Fischer 2025-02-13 14:32:33 UTC
Pushed for 25.05!

Well done everyone, thank you!