Skip to content

Commit 48f49f8

Browse files
committed
test: Add memory leak checks for invalid commands
1 parent f1a3a54 commit 48f49f8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

xt/02_leak.t

+14
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,18 @@ no_leaks_ok {
111111
undef $redis;
112112
} "No Memory leak - pipeline run_event_loop";
113113

114+
no_leaks_ok {
115+
my $redis = Redis::Cluster::Fast->new(
116+
startup_nodes => get_startup_nodes,
117+
);
118+
119+
# broken command
120+
eval {
121+
$redis->get(1, 2);
122+
};
123+
eval {
124+
$redis->get(1, 2, sub {});
125+
};
126+
} "No Memory leak - a error when issuing command";
127+
114128
done_testing;

xt/08_leak_srandom.t

+14
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,18 @@ no_leaks_ok {
115115
undef $redis;
116116
} "No Memory leak - pipeline run_event_loop";
117117

118+
no_leaks_ok {
119+
my $redis = Redis::Cluster::Fast->new(
120+
startup_nodes => get_startup_nodes,
121+
);
122+
123+
# broken command
124+
eval {
125+
$redis->get(1, 2);
126+
};
127+
eval {
128+
$redis->get(1, 2, sub {});
129+
};
130+
} "No Memory leak - a error when issuing command";
131+
118132
done_testing;

0 commit comments

Comments
 (0)