From 873aa29f662e070cf92de045c7aa4fc8e21b7b6b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 3 Jul 2025 09:31:54 +0200 Subject: [PATCH] Bug 40265: (try to) prevent OAI/Server.t to fail on slow server Jenkins failed with: 21:50:07 koha_1 | # got : '2025-06-26T19:50:06Z' 21:50:07 koha_1 | # expect : '2025-06-26T19:50:07Z' A guess is that we change second between the 2 dt_from_string calls, and the comparison fails. One thing however: it seems that we want to deal with timezone correctly here, but if we change the timezone in koha-conf.xml, the tests fail... Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Change looks good, but does not work for another timezone. Signed-off-by: Lucas Gass (cherry picked from commit 73719c417f7ebe9678672040bf5e9f0d9e488b7b) Signed-off-by: Paul Derscheid (cherry picked from commit a712b6863570ef3688f318fce712c7313f548493) Signed-off-by: Baptiste Wojtkowski --- t/db_dependent/OAI/Server.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t index 5da76b4f36..6f6cc378f8 100755 --- a/t/db_dependent/OAI/Server.t +++ b/t/db_dependent/OAI/Server.t @@ -611,7 +611,7 @@ subtest 'Tests for timestamp handling' => sub { my $utc_datetime = dt_from_string(undef, undef, 'UTC'); my $utc_timestamp = $utc_datetime->ymd . 'T' . $utc_datetime->hms . 'Z'; - my $timestamp = dt_from_string(undef, 'sql'); + my $timestamp = $utc_datetime; # Test a bib with one item my $biblio1 = $builder->build_sample_biblio; @@ -711,7 +711,7 @@ subtest 'Tests for timestamp handling' => sub { $utc_datetime = dt_from_string(undef, undef, 'UTC'); $utc_timestamp = $utc_datetime->ymd . 'T' . $utc_datetime->hms . 'Z'; - $timestamp = dt_from_string(undef, 'sql'); + $timestamp = $utc_datetime; my $item2 = $builder->build_sample_item( { @@ -749,7 +749,7 @@ subtest 'Tests for timestamp handling' => sub { set_relative_time(10); $utc_datetime = dt_from_string(undef, undef, 'UTC'); $utc_timestamp= $utc_datetime->ymd . 'T' . $utc_datetime->hms . 'Z'; - $timestamp = dt_from_string(undef, 'sql'); + $timestamp = $utc_datetime; $sth_metadata->execute($timestamp, $biblio1->biblionumber);