1 # Copyright (C) 2016 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use PublicInbox::Config;
7 my $cfgpfx = "publicinbox.test";
9 my $config = PublicInbox::Config->new({
10 "$cfgpfx.address" => 'test@example.com',
11 "$cfgpfx.mainrepo" => '/path/to/non/existent',
12 "$cfgpfx.httpbackendmax" => 12,
14 my $ibx = $config->lookup_name('test');
17 my $lim = $git->{-httpbackend_limiter};
18 ok($lim, 'Limiter exists');
19 is($lim->{max}, 12, 'limiter has expected slots');
22 isnt($old, "$git", 'got new Git object');
23 is("$git->{-httpbackend_limiter}", "$lim", 'same limiter');
27 my $config = PublicInbox::Config->new({
28 'limiter.named.max' => 3,
29 "$cfgpfx.address" => 'test@example.com',
30 "$cfgpfx.mainrepo" => '/path/to/non/existent',
31 "$cfgpfx.httpbackendmax" => 'named',
33 my $ibx = $config->lookup_name('test');
35 ok($git, 'got git object');
37 my $lim = $git->{-httpbackend_limiter};
38 ok($lim, 'Limiter exists');
39 is($lim->{max}, 3, 'limiter has expected slots');
42 PublicInbox::Inbox::weaken_task;
44 isnt($old, "$git", 'got new Git object');
45 is("$git->{-httpbackend_limiter}", "$lim", 'same limiter');
46 is($lim->{max}, 3, 'limiter has expected slots');