File: 53-blpop_and_timeout.t

package info (click to toggle)
libredis-fast-perl 0.29%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 464 kB
  • sloc: perl: 2,540; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 462 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;
use Test::More;
use Test::Fatal;
use Redis::Fast;
use lib 't/tlib';
use Test::SpawnRedisServer;

my ($c, $srv) = redis();
END { $c->() if $c }

unless (fork()) {
    my $redis = Redis::Fast->new(server => $srv, name => 'my_name_is_glorious', reconnect=>1, read_timeout  => 0.3);
    eval { $redis->blpop("notakey", 1); };
    exit 0;
}

wait;

is $?, 0, "does not crash when read_timeout is smaller than BLPOP timeout";


done_testing;