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');
23 isnt($old, "$git", 'got new Git object');
24 is("$git->{-httpbackend_limiter}", "$lim", 'same limiter');
28 my $config = PublicInbox::Config->new({
29 'limiter.named.max' => 3,
30 "$cfgpfx.address" => 'test@example.com',
31 "$cfgpfx.mainrepo" => '/path/to/non/existent',
32 "$cfgpfx.httpbackendmax" => 'named',
34 my $ibx = $config->lookup_name('test');
36 ok($git, 'got git object');
38 my $lim = $git->{-httpbackend_limiter};
39 ok($lim, 'Limiter exists');
40 is($lim->{max}, 3, 'limiter has expected slots');
43 PublicInbox::Inbox::weaken_task;
45 isnt($old, "$git", 'got new Git object');
46 is("$git->{-httpbackend_limiter}", "$lim", 'same limiter');
47 is($lim->{max}, 3, 'limiter has expected slots');