Koha-clms/t/db_dependent/api/v1
Jonathan Druart 6d90376e7b 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@bugs.koha-community.org>
(cherry picked from commit a1bf319829)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2017-10-27 15:08:20 +02:00
..
swagger Bug 17654: Add tests to enforce swagger definition files integrity 2016-11-18 14:04:22 +00:00
cities.t Bug 18292: Remove return 1 statements in tests 2017-09-29 12:02:21 +02:00
holds.t Bug 19405: Prevent api/v1/holds.t to fail randomly 2017-10-27 15:08:20 +02:00
patrons.t Bug 18826 - (QA Followup) Add mock SessionStorage to patrons.t 2017-07-27 12:06:56 +02:00