Bugzilla – Attachment 155594 Details for
Bug 34678
Concurrent changes to the holds can fail due to primary key constraints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34678: Unit test
Bug-34678-Unit-test.patch (text/plain), 1.74 KB, created by
Nick Clemens (kidclamp)
on 2023-09-13 17:10:38 UTC
(
hide
)
Description:
Bug 34678: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-09-13 17:10:38 UTC
Size:
1.74 KB
patch
obsolete
>From 7d4b00e66859039f5d299f0b0ba891fb5909b7c1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 13 Sep 2023 17:01:09 +0000 >Subject: [PATCH] Bug 34678: Unit test > >--- > t/db_dependent/Reserves.t | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 2a6ed48120..cea68ef558 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -1776,7 +1776,7 @@ subtest 'DefaultHoldExpiration tests' => sub { > }; > > subtest '_Findgroupreserves' => sub { >- plan tests => 4; >+ plan tests => 6; > $schema->storage->txn_begin; > > my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >@@ -1828,5 +1828,21 @@ subtest '_Findgroupreserves' => sub { > is( scalar @reserves, 1, "We should only get the item level hold that is in the map" ); > is( $reserves[0]->{reserve_id}, $reserve_id_2, "We got the expected reserve" ); > >+ C4::HoldsQueue::AddToHoldTargetMap( >+ { >+ $item_2->id => { >+ borrowernumber => $patron_2->id, biblionumber => $item->biblionumber, >+ holdingbranch => $item->holdingbranch, item_level => 1, reserve_id => $reserve_id_1 >+ } >+ } >+ ); >+ >+ # When the hold is title level and in the hold fill targets we expect this to be the only hold returned >+ @reserves = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item_2->id, 0, [] ); >+ is( scalar @reserves, 1, "We should still only get the item level hold that is in the map" ); >+ is( $reserves[0]->{reserve_id}, $reserve_id_1, "We got the expected reserve which has been updated" ); >+ >+ >+ > $schema->txn_rollback; > }; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34678
:
155594
|
155595
|
155628
|
155629
|
157913
|
157914
|
157950
|
157951
|
157970
|
157971