Bugzilla – Attachment 98898 Details for
Bug 23571
Add measures to prevent concurrent execution of fines.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23571: [DO NOT PUSH] crash condition builder
Bug-23571-DO-NOT-PUSH-crash-condition-builder.patch (text/plain), 2.89 KB, created by
Hugo Agud
on 2020-02-14 07:53:59 UTC
(
hide
)
Description:
Bug 23571: [DO NOT PUSH] crash condition builder
Filename:
MIME Type:
Creator:
Hugo Agud
Created:
2020-02-14 07:53:59 UTC
Size:
2.89 KB
patch
obsolete
>From c41182146a6fd3d4d8e1bfad737d8922e054daae Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 3 Dec 2019 23:12:00 -0300 >Subject: [PATCH] Bug 23571: [DO NOT PUSH] crash condition builder > >This patch adds t/db_dependent/bug_23571_crash_condition_builder.t file >This file is not intended to be part of Koha, but it's used to emulate crash conditions. >It will create 5000 users, 5000 biblios with 2 items each, and each item issued to a user. >It really takes a lot of time, so please be zen about it ;) > >To use it execute >prove t/db_dependent/bug_23571_crash_condition_builder.t > >Sponsored-by: Orex Digital > >Signed-off-by: Hugo Agud <hagud@orex.es> >--- > t/db_dependent/bug_23571_crash_condition_builder.t | 58 ++++++++++++++++++++++ > 1 file changed, 58 insertions(+) > create mode 100644 t/db_dependent/bug_23571_crash_condition_builder.t > >diff --git a/t/db_dependent/bug_23571_crash_condition_builder.t b/t/db_dependent/bug_23571_crash_condition_builder.t >new file mode 100644 >index 0000000000..4a256213a0 >--- /dev/null >+++ b/t/db_dependent/bug_23571_crash_condition_builder.t >@@ -0,0 +1,58 @@ >+# >+# WARNING!!!!! >+# THIS FILE SHOULD NOT BE A PART OF KOHA, AND IF YOU WON'T TEST BUG 23571 YOU SHOULD NOT USE IT >+# THIS FILE IS CREATED TO FILL DATABASE WITH USERS, BIBLIOS, ITEMS AND ISSUES >+# YOUR DATABASE MAY END CORRUPTED >+# PLEASE USE IT ON TEST / DEVELOPMENT DATABASE >+# >+ >+use Modern::Perl; >+ >+use Test::More tests => 1; >+ >+use t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+use Koha::Database; >+ >+use C4::Circulation; >+ >+#use Data::Printer colored => 1; >+ >+subtest "create 5000 patrons, 5000 biblios, 10000 items and 10000 issues" => sub { >+ plan tests => 1; >+ ok(1, 'Everything is wondeful!'); >+ my $me = 'parent'; >+ if(my $pid = fork) { >+ } elsif (defined $pid) { >+ $me = 'child'; >+ } else { >+ # fork failed, so exit immediately >+ # fork failed, so exit immediately >+ warn "fork failed while attempting to run offline_circ/process_koc.pl as a background job"; >+ exit 0; >+ } >+ >+ my $builder = t::lib::TestBuilder->new; >+ >+ my $library = $builder->build( { source => 'Branch' } ); >+ >+ t::lib::Mocks::mock_userenv({ branchcode => $library->{branchcode} }); >+ >+ my $count = 2500; >+ while($count-- >= 0) { >+ warn "\n$me: $count loops to go, ".($count > 1250?"grab a cup of tea":"refill tea")."\n"; >+ my $patron = $builder->build({ source => 'Borrower' }); >+ #p($patron); >+ my $biblio = $builder->build_sample_biblio; >+ my $item1 = $builder->build_sample_item({ >+ biblionumber => $biblio->biblionumber, >+ }); >+ my $item2 = $builder->build_sample_item({ >+ biblionumber => $biblio->biblionumber, >+ }); >+ C4::Circulation::AddIssue( $patron, $item1->barcode ); >+ C4::Circulation::AddIssue( $patron, $item2->barcode ); >+ } >+ >+} >\ No newline at end of file >-- >2.11.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 23571
:
96055
|
96056
|
98898
|
98899
|
99263
|
99264
|
99265
|
102772
|
102804
|
102821
|
102844
|
102888
|
102910
|
102911
|
102912