From 835515b04ee6599348aca5fa5675a09ddb3ded12 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 19 Feb 2024 10:45:50 +0000 Subject: [PATCH] Bug 32565: QA Follow-up: Fix tests Apply original tests patch + this follow-up. Run: prove t/db_dependent/HoldsQueue.t Notice tests fail. Apply fix patch, run the above prove command again. Notice tests pass. Signed-off-by: Pedro Amorim --- t/db_dependent/HoldsQueue.t | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/HoldsQueue.t b/t/db_dependent/HoldsQueue.t index 531f9edb80a..987aba21ee3 100755 --- a/t/db_dependent/HoldsQueue.t +++ b/t/db_dependent/HoldsQueue.t @@ -2252,19 +2252,20 @@ subtest "Test unallocated option" => sub { "Picked the item" ); - my $timestamp = $hold->timestamp; + my $original_timestamp = $hold->timestamp; - sleep 2; + sleep 2; # Allow time to pass after first hold was placed C4::HoldsQueue::CreateQueue(); $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); $hold = $queue_rs->next; - isnt( $hold->timestamp, $timestamp, "Hold was reallocated when queue fully rebuilt" ); - $timestamp = $hold->timestamp; + isnt( $hold->timestamp, $original_timestamp, "Hold was reallocated when queue fully rebuilt" ); + my $after_rebuild_timestamp = $hold->timestamp; + sleep 2; # Allow time to pass after first full rebuild C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); $hold = $queue_rs->next; - is( $hold->timestamp, $timestamp, "Previously allocated hold not updated when unallocated passed" ); + is( $hold->timestamp, $after_rebuild_timestamp, "Previously allocated hold not updated when unallocated passed" ); my $reserve_id_2 = AddReserve( { @@ -2285,7 +2286,7 @@ subtest "Test unallocated option" => sub { $queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); $hold = $queue_rs->next; is( - $hold->timestamp, $timestamp, + $hold->timestamp, $after_rebuild_timestamp, "Previously allocated hold not updated when unallocated passed and others are allocated" ); }; -- 2.30.2