1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#!/usr/bin/perl
use v5.26;
use warnings;
use Test2::V0;
BEGIN {
plan skip_all => "No Test::MemoryGrowth" unless eval { require Test::MemoryGrowth };
}
use Test::MemoryGrowth;
use Tangence::Constants;
use Tangence::Registry;
use lib ".";
use t::TestObj;
use t::TestServerClient;
my $registry = Tangence::Registry->new(
tanfile => "t/TestObj.tan",
);
my $obj = $registry->construct(
"t::TestObj",
scalar => 123,
s_scalar => 456,
);
no_growth {
my ( $server, $client ) = make_serverclient( $registry );
my $objproxy = $client->rootobj;
$objproxy->watch_property( "scalar",
on_set => sub {},
)->get;
$server->tangence_closed;
$client->tangence_closed;
} calls => 1000,
'Connect/watch/disconnect does not grow memory';
done_testing;
|