From 35c26e4d265c8f085b72deb1773083925302aa41 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 22 Sep 2022 08:09:41 +0000 Subject: [PATCH] Bug 31598: Fix random failure on Jenkins for Upload.t Content-Type: text/plain; charset=utf-8 At some point the warn is made conditional for permanent files. So it failed when TestBuilder picked a zero value for permanent. Trivial fix. Test plan: Run t/db_dependent/Upload.t a few times Signed-off-by: Marcel de Rooy --- t/db_dependent/Upload.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Upload.t b/t/db_dependent/Upload.t index 69506c0a5d..8b3fa3c1f0 100755 --- a/t/db_dependent/Upload.t +++ b/t/db_dependent/Upload.t @@ -175,11 +175,11 @@ subtest 'Test delete via UploadedFile as well as UploadedFiles' => sub { isnt( -e $path, 1, 'File no longer found after delete' ); # add another record with TestBuilder, so file does not exist - # catch warning - my $upload01 = $builder->build({ source => 'UploadedFile' }); + # catch warning (which occurs when deleting permanent file) + my $upload01 = $builder->build({ source => 'UploadedFile', value => { permanent => 1 } }); warning_like { $delete = Koha::UploadedFiles->find( $upload01->{id} )->delete; } qr/file was missing/, - 'delete warns when file is missing'; + 'delete warns when permanent file is missing'; ok( $delete, 'Deleting record was successful' ); is( Koha::UploadedFiles->count, 4, 'Back to four uploads now' ); -- 2.30.2