Bug 36356 - FrameworkPlugin.t does not rollback properly
Summary: FrameworkPlugin.t does not rollback properly
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25515
  Show dependency treegraph
 
Reported: 2024-03-19 08:16 UTC by Jonathan Druart
Modified: 2024-12-23 08:07 UTC (History)
2 users (show)

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


Attachments
Bug 36356: Fix rollback from FrameworkPlugin.t (1.40 KB, patch)
2024-03-19 08:20 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 Jonathan Druart 2024-03-19 08:16:37 UTC
Long story short: If too many libraries exist in the DB we have some tests failing:

Bug 36277 because of 2 nested loops on the library list
Bug 36355 because we are fetching the library list from the REST API

This is because FrameworkPlugin.t is not rolling back properly, and the output of the tests is telling it:

% prove t/db_dependent/FrameworkPlugin.t                    t/db_dependent/FrameworkPlugin.t .. 5/6 rollback ineffective with AutoCommit enabled at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1651.
t/db_dependent/FrameworkPlugin.t .. ok                                                                    All tests successful.                                                                                     
Files=1, Tests=6, 14 wallclock secs ( 0.03 usr  0.01 sys + 11.17 cusr  2.63 csys = 13.84 CPU)             Result: PASS
Comment 1 Jonathan Druart 2024-03-19 08:20:53 UTC
Created attachment 163379 [details] [review]
Bug 36356: Fix rollback from FrameworkPlugin.t

rollback ineffective with AutoCommit enabled at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1651.

I have not investigated more than that. Reaching this was already the
end of a long road... (see comment 0)

Test plan:
0. Do not apply this patch
1. select count(*) from branches
Note the value
2. Run
  prove t/db_dependent/FrameworkPlugin.t
=> There is a warning
3. Repeat 1.
=> There are too many libraries!
4. Apply the patch, retry 1, 2, 3
=> No warning, no library added by the tests
Comment 2 Jonathan Druart 2024-03-19 08:26:01 UTC
(In reply to Jonathan Druart from comment #0)
> Bug 36355 because we are fetching the library list from the REST API

This is not correct. See there for more info.
Comment 3 Katrin Fischer 2024-03-19 08:38:08 UTC
Change is small, let's do the final test on Jenkins (passing locally).
Comment 4 Katrin Fischer 2024-03-19 09:27:58 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 5 Fridolin Somers 2024-03-21 10:07:15 UTC
Pushed to 23.11.x for 23.11.04
Comment 6 Lucas Gass (lukeg) 2024-05-13 14:36:56 UTC
Backported to 23.05.x for upcoming 23.05.12