[Koha-bugs] [Bug 19405] t/db_dependent/api/v1/holds.t fails randomly

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 4 00:21:19 CEST 2017


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

--- Comment #1 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 67578
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67578&action=edit
Bug 19405: Prevent api/v1/holds.t to fail randomly

DBD::mysql::st execute failed: Duplicate entry
'cEMggO40gdPLhcVXbpry8x0izO8lHr8NafFIBJwm0D1HgiXA57YR0a0VVxhQBzvn' for key
'userid' [for Statement "INSERT INTO `borrowers` ( `branchcode`,
`categorycode`, `flags`, `surname`, `userid`) VALUES ( ?, ?, ?, ?, ? )" with
ParamValues: 0='N2ElsY9', 1='Kk8G', 2=80, 3='Test Surname',
4='cEMggO40gdPLhcVXbpry8x0izO8lHr8NafFIBJwm0D1HgiXA57YR0a0VVxhQBzvnnbgezJqmxqwz']
at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.
DBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry
'cEMggO40gdPLhcVXbpry8x0izO8lHr8NafFIBJwm0D1HgiXA57YR0a0VVxhQBzvn' for key
'userid' at /kohadevbox/koha/Koha/Object.pm line 121
[18:52:19] t/db_dependent/api/v1/holds.t

Reading the code I guess it happens if TestBuilder generates a userid with the
size of borrowers.userid (75 chars). In that case the following lines are
wrong:

$borrower->userid($nopermission->{ userid }."z");
$borrower2->userid($nopermission->{ userid }."x");
$borrower3->userid($nopermission->{ userid }."y");

The 3 patrons will have the same userid.

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

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


More information about the Koha-bugs mailing list