Bugzilla – Attachment 77935 Details for
Bug 21238
TemplateToolkit.t is failing on slow server
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers
Bug-21238-Prevent-TemplateToolkitt-to-fail-on-slow.patch (text/plain), 1.73 KB, created by
Martin Renvoize (ashimema)
on 2018-08-16 15:40:32 UTC
(
hide
)
Description:
Bug 21238: Prevent TemplateToolkit.t to fail on slow servers
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-08-16 15:40:32 UTC
Size:
1.73 KB
patch
obsolete
>From c9f6ef412dd237d96cf1b340b5913d7a8a02abea Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 16 Aug 2018 12:29:43 -0300 >Subject: [PATCH] Bug 21238: Prevent TemplateToolkit.t to fail on slow servers > >It failed 3x in the last 6 runs (on node 1), we should mock >DateTime->now to prevent it to fail again. > >The error is: >koha_1 | # Failed test at >t/db_dependent/Letters/TemplateToolkit.t line 724. > >When comparing <<today>> replacement: >koha_1 | # 08/16/2018 14:25<br /> >[...] >koha_1 | # 08/16/2018 14:24<br /> > >Let's mock DateTime->now to prevent it to fail again. > >Test plan: >0. Do not apply this patch >1. Add "sleep(60);" at line ~715, before "# Add a second checkout" >2. Run the tests >=> Fail! >3. Apply this patch >4. Run the tests again >=> Pass! > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Letters/TemplateToolkit.t | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t >index c4f4e82866..2714317458 100644 >--- a/t/db_dependent/Letters/TemplateToolkit.t >+++ b/t/db_dependent/Letters/TemplateToolkit.t >@@ -20,6 +20,7 @@ > > use Modern::Perl; > use Test::More tests => 18; >+use Test::MockModule; > use Test::Warn; > > use MARC::Record; >@@ -56,7 +57,9 @@ $dbh->{RaiseError} = 1; > > $dbh->do(q|DELETE FROM letter|); > >-my $date = dt_from_string; >+my $now_value = DateTime->now(); >+my $mocked_datetime = Test::MockModule->new('DateTime'); >+$mocked_datetime->mock( 'now', sub { return $now_value->clone; } ); > > my $library = $builder->build( { source => 'Branch' } ); > my $patron = $builder->build( { source => 'Borrower' } ); >-- >2.18.0
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 21238
:
77934
|
77935
|
77958
|
77959