Bugzilla – Attachment 56719 Details for
Bug 17476
Failed test 'Create DateTime with dt_from_string() for 2100-01-01 with TZ in less than 2s'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17476: Add a way to bypass dt_from_string processing time for slow servers
Bug-17476-Add-a-way-to-bypass-dtfromstring-process.patch (text/plain), 2.25 KB, created by
Mirko Tietgen
on 2016-10-21 10:08:00 UTC
(
hide
)
Description:
Bug 17476: Add a way to bypass dt_from_string processing time for slow servers
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2016-10-21 10:08:00 UTC
Size:
2.25 KB
patch
obsolete
>From 8610419e15f983250058d447bd87b7d3c15e257c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 21 Oct 2016 07:01:30 +0000 >Subject: [PATCH] Bug 17476: Add a way to bypass dt_from_string processing time > for slow servers > >We already change this value from 1 to 2 but apparently it's not enough >So let's switch it back to on and add a flag (env var SLOW_SERVER) and skip these tests >if set > >Test plan: > prove t/DateUtils.t >and > SLOW_SERVER=1 prove t/DateUtils.t > >should return green > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >--- > t/DateUtils.t | 23 +++++++++++++---------- > 1 file changed, 13 insertions(+), 10 deletions(-) > >diff --git a/t/DateUtils.t b/t/DateUtils.t >index eede4a0..47cf1c5 100755 >--- a/t/DateUtils.t >+++ b/t/DateUtils.t >@@ -75,16 +75,19 @@ isa_ok( $new_dt, 'DateTime', 'Create DateTime with different timezone' ); > cmp_ok( $new_dt->ymd(), 'eq', $testdate_iso, > 'Returned Dublin object matches input' ); > >-for ( qw/ 2014-01-01 2100-01-01 9999-01-01 / ) { >- my $duration = gettimeofday(); >- $new_dt = dt_from_string($_, 'iso', $dear_dirty_dublin); >- $duration = gettimeofday() - $duration; >- cmp_ok $duration, '<', 2, "Create DateTime with dt_from_string() for $_ with TZ in less than 2s"; >- $duration = gettimeofday(); >- output_pref( { dt => $new_dt } ); >- $duration = gettimeofday() - $duration; >- cmp_ok $duration, '<', 2, "Create DateTime with output_pref() for $_ with TZ in less than 2s"; >-} >+SKIP: { >+ skip "Don't test execution time of dt_from_string on slow servers", 6 if $ENV{SLOW_SERVER}; >+ for ( qw/ 2014-01-01 2100-01-01 9999-01-01 / ) { >+ my $duration = gettimeofday(); >+ $new_dt = dt_from_string($_, 'iso', $dear_dirty_dublin); >+ $duration = gettimeofday() - $duration; >+ cmp_ok $duration, '<', 1, "Create DateTime with dt_from_string() for $_ with TZ in less than 1s"; >+ $duration = gettimeofday(); >+ output_pref( { dt => $new_dt } ); >+ $duration = gettimeofday() - $duration; >+ cmp_ok $duration, '<', 1, "Create DateTime with output_pref() for $_ with TZ in less than 1s"; >+ } >+}; > > $new_dt = dt_from_string( '2011-06-16 12:00', 'sql' ); > isa_ok( $new_dt, 'DateTime', 'Create DateTime from (mysql) sql' ); >-- >2.1.4
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 17476
:
56716
|
56719
|
57232