Not sure what happened exactly. But a failing Circulation.t must have removed all users in my devbox. # Start with a clean slate $dbh->do('DELETE FROM issues'); $dbh->do('DELETE FROM borrowers'); And my borrowers: select borrowernumber,userid,lastseen from borrowers; +----------------+---------------------------------------------------------------------------+---------------------+ | borrowernumber | userid | lastseen | +----------------+---------------------------------------------------------------------------+---------------------+ | 382 | pCITR3m30mWAv4MTsEhckB0QR1JoJFgBac2mdWx | 2022-03-01 13:01:39 | | 383 | sazlgFEfa4UmwVgniArAfluzcETJXkru9ktdHKYzSqTXwYckCAXNje3ZpqfRabaz42p | 2022-03-01 13:01:39 | | 384 | VkGSPpUO7VFE2it55nZ2pflAmo75HUin4eYVKtThczB7tUF_AZFXuOcg95_Q | 2022-03-01 13:01:39 | | 385 | opoi06B6_LWhoOXQtTjYrN01Vm182og8OK6Uaezc_CfNnA6SYicmnWzb2hEeZF_ | 2022-03-01 13:01:39 | | 386 | john.renewal | NULL | | 387 | katrin.reservation | NULL | | 388 | kyle.reservation | NULL | | 389 | alice.reservation | NULL | | 390 | ca.glisse | NULL | | 391 | T5MrUI8DftRsa_nou6Q_VO76Wby4HAfcDsNP9WXk3gom8 | 2022-03-01 13:01:39 | | 392 | goV_DQYtptbpxYFdUtEcpJqz9X4fq3Zn4Arf336wEvxvc7rF8prBsQRDLq8_8FZhQypuamFi | 2022-03-01 13:01:39 | | 393 | fridolyn.somers | NULL | | 394 | kyle.hall | NULL | | 395 | kyle.hall1 | NULL | | 396 | chelsea.hall | NULL | | 397 | fn.dn | NULL | etc etc The family Hall are prominently visible now :) But Katrin and Fridolin too..
Hmm. I should have known. One of the last subtests calls SendCirculationAlert.. And that sub includes one of the worst Koha hacks: # LOCK TABLES is not transaction-safe and implicitly commits any active transaction before attempting to lock the tables. # If the LOCK/UNLOCK statements are executed from tests, the current transaction will be committed. # To avoid that we need to guess if this code is execute from tests or not (yes it is a bit hacky) my $do_not_lock = ( exists $ENV{_} && $ENV{_} =~ m|prove| ) || $ENV{KOHA_TESTING}; I will send a patch instead of closing this report btw.
Created attachment 131314 [details] [review] Bug 30203: Circulation.t: prevent locking by setting envvar Running this test without prove is disastrous. The LOCK in the called SendCirculationAlert will ruin your data. But no longer when you apply this patch. Test plan: Run prove Circulation.t Inspect your data (e.g. borrowers table). Run perl Circulation.t Inspect your data (e.g. borrowers table) again. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This is a trivial edit but really handy to keep you focus on development instead of reinstalling or restoring db. Very trivial: Self SO
Created attachment 131315 [details] [review] Bug 30203: Circulation.t: prevent locking by setting envvar Running this test without prove is disastrous. The LOCK in the called SendCirculationAlert will ruin your data. But no longer when you apply this patch. Test plan: Run prove Circulation.t Inspect your data (e.g. borrowers table). Run perl Circulation.t Inspect your data (e.g. borrowers table) again. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Fix is clear and test plan works as expected. PQA
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
I see this is in 21.11.x for 21.11.4 Pushed to 21.05.x for 21.05.13
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.