View | Details | Raw Unified | Return to bug 32561
Collapse All | Expand All

(-)a/xt/memory_check.t (-1 / +36 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
use Test::More tests => 1;
20
21
my @background_job_processes = qx{top -n1|grep background|tr -s ' '|cut -d' ' -f6};
22
my $pid = qx[ps ax | grep 'background_jobs_worker.pl --queue default' | grep -v grep | tail -n1 | awk '{print \$1}'];
23
24
chomp $pid;
25
26
SKIP: {
27
    skip "No background_jobs_worker.pl process running for the default queue", 1
28
        unless $pid;
29
    my $memory_usage = qx[pmap -x $pid | tail -n 1 | awk '/[0-9]/{print \$3}'];
30
    chomp $memory_usage;
31
    if ( $memory_usage > 150000 ) {
32
        fail("background_jobs_worker.pl is consuming more than 150Mo in memory: $memory_usage");
33
    } else {
34
        pass("background_jobs_worker.pl is consuming $memory_usage in memory");
35
    }
36
}

Return to bug 32561