Bugzilla – Attachment 58249 Details for
Bug 15108
OAI-PMH provider improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15108: [QA Follow-up] Remove the sleep
Bug-15108-QA-Follow-up-Remove-the-sleep.patch (text/plain), 2.50 KB, created by
Marcel de Rooy
on 2016-12-16 11:03:12 UTC
(
hide
)
Description:
Bug 15108: [QA Follow-up] Remove the sleep
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-12-16 11:03:12 UTC
Size:
2.50 KB
patch
obsolete
>From bcfe79fcfd9ff951a44852d3baab1cbc0c7d8a30 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 9 Dec 2016 11:26:33 +0100 >Subject: [PATCH] Bug 15108: [QA Follow-up] Remove the sleep >Content-Type: text/plain; charset=utf-8 > >Ordering by timestamp, biblionumber in ListBase.pm c/would be a >performance killer. >In order to speed up the test, we manipulate the timestamp. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/OAI/Server.t | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/OAI/Server.t b/t/db_dependent/OAI/Server.t >index cd643b7..76a142f 100644 >--- a/t/db_dependent/OAI/Server.t >+++ b/t/db_dependent/OAI/Server.t >@@ -47,6 +47,8 @@ BEGIN { > use_ok('Koha::OAI::Server::ResumptionToken'); > } > >+use constant NUMBER_OF_MARC_RECORDS => 10; >+ > # Mocked CGI module in order to be able to send CGI parameters to OAI Server > my %param; > my $module = Test::MockModule->new('CGI'); >@@ -67,14 +69,15 @@ my $date_to = substr($date_added, 0, 10) . 'T23:59:59Z'; > my (@header, @marcxml, @oaidc); > my $sth = $dbh->prepare('SELECT timestamp FROM biblioitems WHERE biblionumber=?'); > >-# Add 10 biblio records >-foreach my $index ( 0..9 ) { >+# Add biblio records >+foreach my $index ( 0 .. NUMBER_OF_MARC_RECORDS - 1 ) { > my $record = MARC::Record->new(); > $record->append_fields( MARC::Field->new('245', '', '', 'a' => "Title $index" ) ); > my ($biblionumber) = AddBiblio($record, ''); > $sth->execute($biblionumber); > my $timestamp = $sth->fetchrow_array . 'Z'; > $timestamp =~ s/ /T/; >+ $timestamp = manipulate_timestamp( $index, $biblionumber, $timestamp ); > $record = GetMarcBiblio($biblionumber); > $record = XMLin($record->as_xml_record); > push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" }; >@@ -112,7 +115,6 @@ foreach my $index ( 0..9 ) { > }, > }, > }; >- sleep 2; # FIXME Why do we need this sleep? > } > > my $syspref = { >@@ -343,3 +345,15 @@ test_query( > }); > > $schema->storage->txn_rollback; >+ >+sub manipulate_timestamp { >+# This eliminates waiting a few seconds in order to get a higher timestamp >+# Works only for 60 records.. >+ my ( $index, $bibno, $timestamp ) = @_; >+ return $timestamp if $timestamp !~ /\d{2}Z/; >+ my $secs = sprintf( "%02d", $index ); >+ $timestamp =~ s/\d{2}Z/${secs}Z/; >+ $dbh->do("UPDATE biblioitems SET timestamp=? WHERE biblionumber=?", undef, >+ ( $timestamp, $bibno )); >+ return $timestamp; >+} >-- >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 15108
:
44317
|
44318
|
51962
|
52416
|
52422
|
52423
|
53853
|
53854
|
56813
|
56844
|
58058
|
58059
|
58060
|
58061
|
58062
|
58063
|
58064
|
58065
|
58072
|
58080
|
58245
|
58246
|
58247
|
58248
|
58249
|
58250
|
58251
|
60260
|
60331
|
60608
|
60835
|
60836
|
63172
|
63173
|
63174