Bugzilla – Attachment 144986 Details for
Bug 32561
background job worker is still running with all the modules in RAM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32561: Test loaded modules for background_jobs_worker.pl
Bug-32561-Test-loaded-modules-for-backgroundjobswo.patch (text/plain), 2.27 KB, created by
Kyle M Hall (khall)
on 2023-01-04 11:53:49 UTC
(
hide
)
Description:
Bug 32561: Test loaded modules for background_jobs_worker.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-01-04 11:53:49 UTC
Size:
2.27 KB
patch
obsolete
>From d55354bffef31db7da42d02ebb859fb8ae2903c3 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Wed, 4 Jan 2023 06:52:03 -0500 >Subject: [PATCH] Bug 32561: Test loaded modules for background_jobs_worker.pl > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/background_jobs_worker.pl | 8 ++++++-- > xt/memory_check.t | 6 +++++- > 2 files changed, 11 insertions(+), 3 deletions(-) > >diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl >index eb36f34f96..213b4ad711 100755 >--- a/misc/background_jobs_worker.pl >+++ b/misc/background_jobs_worker.pl >@@ -21,7 +21,7 @@ background_jobs_worker.pl - Worker script that will process background jobs > > =head1 SYNOPSIS > >-./background_jobs_worker.pl [--queue QUEUE] >+./background_jobs_worker.pl [--queue QUEUE] [-m] > > =head1 DESCRIPTION > >@@ -30,6 +30,7 @@ or if a Stomp server is not active it will poll the database every 10s for new j > > You can specify some queues only (using --queue, which is repeatable) if you want to run several workers that will handle their own jobs. > >+-m or --modules will cause the script to print the included Perl modules and exit. > =head1 OPTIONS > > =over >@@ -55,14 +56,17 @@ use Getopt::Long; > > use Koha::BackgroundJobs; > >-my ( $help, @queues ); >+my ( $help, @queues, $modules ); > GetOptions( > 'h|help' => \$help, > 'queue=s' => \@queues, >+ 'm|modules' => \$modules, > ) || pod2usage(1); > > pod2usage(0) if $help; > >+if ($modules) { print join "\n", %INC; print "\n"; exit 0; } >+ > unless (@queues) { > push @queues, 'default'; > } >diff --git a/xt/memory_check.t b/xt/memory_check.t >index eaaa860870..833509fd1a 100644 >--- a/xt/memory_check.t >+++ b/xt/memory_check.t >@@ -16,7 +16,8 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 1; >+use Test::More tests => 2; >+use FindBin; > > my $pid = qx[ps ax | grep 'background_jobs_worker.pl --queue default' | grep -v grep | tail -n1 | awk '{print \$1}']; > >@@ -34,3 +35,6 @@ SKIP: { > pass("background_jobs_worker.pl is consuming $memory_usage in memory"); > } > } >+ >+my $output = qx{$FindBin::Bin/../misc/background_jobs_worker.pl -m | grep 'Koha/Plugins.pm'}; >+is( $output, q{}, "Koha::Plugins not loaded by background_jobs_worker.pl" ); >-- >2.30.2
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 32561
:
144973
|
144974
|
144975
|
144984
|
144985
|
144986
|
145617