"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/protocol.tcl" between
redis-6.2.4.tar.gz and redis-6.2.5.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

protocol.tcl  (redis-6.2.4):protocol.tcl  (redis-6.2.5)
skipping to change at line 105 skipping to change at line 105
if {$elapsed > $test_time_limit} { if {$elapsed > $test_time_limit} {
close $s close $s
error "assertion:Redis did not closed connection after p rotocol desync" error "assertion:Redis did not closed connection after p rotocol desync"
} }
} }
} }
set retval set retval
} {*Protocol error*} } {*Protocol error*}
} }
unset c unset c
# recover the broken connection
reconnect
r ping
# raw RESP response tests
r readraw 1
test "raw protocol response" {
r srandmember nonexisting_key
} {*-1}
r deferred 1
test "raw protocol response - deferred" {
r srandmember nonexisting_key
r read
} {*-1}
test "raw protocol response - multiline" {
r sadd ss a
assert_equal [r read] {:1}
r srandmember ss 100
assert_equal [r read] {*1}
assert_equal [r read] {$1}
assert_equal [r read] {a}
}
# restore connection settings
r readraw 0
r deferred 0
# check the connection still works
assert_equal [r ping] {PONG}
test {RESP3 attributes} {
r hello 3
set res [r debug protocol attrib]
# currently the parser in redis.tcl ignores the attributes
# restore state
r hello 2
set _ $res
} {Some real reply following the attribute}
test {RESP3 attributes readraw} {
r hello 3
r readraw 1
r deferred 1
r debug protocol attrib
assert_equal [r read] {|1}
assert_equal [r read] {$14}
assert_equal [r read] {key-popularity}
assert_equal [r read] {*2}
assert_equal [r read] {$7}
assert_equal [r read] {key:123}
assert_equal [r read] {:90}
assert_equal [r read] {$39}
assert_equal [r read] {Some real reply following the attribute}
# restore state
r readraw 0
r deferred 0
r hello 2
set _ {}
} {}
test {RESP3 attributes on RESP2} {
r hello 2
set res [r debug protocol attrib]
set _ $res
} {Some real reply following the attribute}
test "test big number parsing" {
r hello 3
r debug protocol bignum
} {1234567999999999999999999999999999999}
test "test bool parsing" {
r hello 3
assert_equal [r debug protocol true] 1
assert_equal [r debug protocol false] 0
r hello 2
assert_equal [r debug protocol true] 1
assert_equal [r debug protocol false] 0
set _ {}
} {}
} }
start_server {tags {"regression"}} { start_server {tags {"regression"}} {
test "Regression for a crash with blocking ops and pipelining" { test "Regression for a crash with blocking ops and pipelining" {
set rd [redis_deferring_client] set rd [redis_deferring_client]
set fd [r channel] set fd [r channel]
set proto "*3\r\n\$5\r\nBLPOP\r\n\$6\r\nnolist\r\n\$1\r\n0\r\n" set proto "*3\r\n\$5\r\nBLPOP\r\n\$6\r\nnolist\r\n\$1\r\n0\r\n"
puts -nonewline $fd $proto$proto puts -nonewline $fd $proto$proto
flush $fd flush $fd
set res {} set res {}
 End of changes. 1 change blocks. 
0 lines changed or deleted 88 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)