From 695599fe6e8780fc74d36951165420947a05941c 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... --- 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 1c31c64e73c..2dd27082e2b 100755 --- a/t/db_dependent/OAI/Server.t +++ b/t/db_dependent/OAI/Server.t @@ -677,7 +677,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; @@ -774,7 +774,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( { biblionumber => $biblio1->biblionumber } ); $sth_item->execute( $timestamp, $item2->itemnumber ); @@ -808,7 +808,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 ); -- 2.34.1