Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a6504a16
Unverified
Commit
a6504a16
authored
Jul 10, 2020
by
Itamar Haber
Committed by
GitHub
Jul 10, 2020
Browse files
Merge branch 'unstable' into conduct
parents
91d30968
d5648d61
Changes
28
Show whitespace changes
Inline
Side-by-side
tests/support/util.tcl
View file @
a6504a16
...
@@ -99,11 +99,27 @@ proc wait_for_ofs_sync {r1 r2} {
...
@@ -99,11 +99,27 @@ proc wait_for_ofs_sync {r1 r2} {
}
}
}
}
proc wait_for_log_message
{
srv_idx pattern last_lines maxtries delay
}
{
# count current log lines in server's stdout
proc count_log_lines
{
srv_idx
}
{
set _
[
exec wc -l <
[
srv $srv_idx stdout
]]
}
# verify pattern exists in server's sdtout after a certain line number
proc verify_log_message
{
srv_idx pattern from_line
}
{
set lines_after
[
count_log_lines
]
set lines
[
expr $lines_after - $from_line
]
set result
[
exec tail -$lines <
[
srv $srv_idx stdout
]]
if
{
!
[
string match $pattern $result
]}
{
error
"assertion:expected message not found in log file:
$pattern
"
}
}
# wait for pattern to be found in server's stdout after certain line number
proc wait_for_log_message
{
srv_idx pattern from_line maxtries delay
}
{
set retry $maxtries
set retry $maxtries
set stdout
[
srv $srv_idx stdout
]
set stdout
[
srv $srv_idx stdout
]
while
{
$retry
}
{
while
{
$retry
}
{
set result
[
exec tail
-$last
_line
s
< $stdout
]
set result
[
exec tail
+$from
_line < $stdout
]
set result
[
split $result
"
\n
"
]
set result
[
split $result
"
\n
"
]
foreach line $result
{
foreach line $result
{
if
{[
string match $pattern $line
]}
{
if
{[
string match $pattern $line
]}
{
...
@@ -114,7 +130,7 @@ proc wait_for_log_message {srv_idx pattern last_lines maxtries delay} {
...
@@ -114,7 +130,7 @@ proc wait_for_log_message {srv_idx pattern last_lines maxtries delay} {
after $delay
after $delay
}
}
if
{
$retry
== 0
}
{
if
{
$retry
== 0
}
{
fail
"log message of '
$pattern
' not found"
fail
"log message of '
$pattern
' not found
in
$stdout
after line:
$from
_line
"
}
}
}
}
...
...
tests/test_helper.tcl
View file @
a6504a16
...
@@ -35,6 +35,7 @@ set ::all_tests {
...
@@ -35,6 +35,7 @@ set ::all_tests {
unit/quit
unit/quit
unit/aofrw
unit/aofrw
unit/acl
unit/acl
unit/latency-monitor
integration/block-repl
integration/block-repl
integration/replication
integration/replication
integration/replication-2
integration/replication-2
...
@@ -48,6 +49,7 @@ set ::all_tests {
...
@@ -48,6 +49,7 @@ set ::all_tests {
integration/psync2
integration/psync2
integration/psync2-reg
integration/psync2-reg
integration/psync2-pingoff
integration/psync2-pingoff
integration/redis-cli
unit/pubsub
unit/pubsub
unit/slowlog
unit/slowlog
unit/scripting
unit/scripting
...
...
tests/unit/dump.tcl
View file @
a6504a16
...
@@ -37,6 +37,17 @@ start_server {tags {"dump"}} {
...
@@ -37,6 +37,17 @@ start_server {tags {"dump"}} {
r get foo
r get foo
}
{
bar
}
}
{
bar
}
test
{
RESTORE with ABSTTL in the past
}
{
r set foo bar
set encoded
[
r dump foo
]
set now
[
clock milliseconds
]
r debug set-active-expire 0
r restore foo
[
expr $now-3000
]
$encoded absttl REPLACE
catch
{
r debug object foo
}
e
r debug set-active-expire 1
set e
}
{
ERR no such key
}
test
{
RESTORE can set LRU
}
{
test
{
RESTORE can set LRU
}
{
r set foo bar
r set foo bar
set encoded
[
r dump foo
]
set encoded
[
r dump foo
]
...
...
tests/unit/introspection.tcl
View file @
a6504a16
...
@@ -78,17 +78,8 @@ start_server {tags {"introspection"}} {
...
@@ -78,17 +78,8 @@ start_server {tags {"introspection"}} {
syslog-facility
syslog-facility
databases
databases
port
port
io-threads
tls-port
tls-port
tls-prefer-server-ciphers
io-threads
tls-cert-file
tls-key-file
tls-dh-params-file
tls-ca-cert-file
tls-ca-cert-dir
tls-protocols
tls-ciphers
tls-ciphersuites
logfile
logfile
unixsocketperm
unixsocketperm
slaveof
slaveof
...
@@ -100,6 +91,23 @@ start_server {tags {"introspection"}} {
...
@@ -100,6 +91,23 @@ start_server {tags {"introspection"}} {
bgsave_cpulist
bgsave_cpulist
}
}
if
{
!$::tls
}
{
append skip_configs
{
tls-prefer-server-ciphers
tls-session-cache-timeout
tls-session-cache-size
tls-session-caching
tls-cert-file
tls-key-file
tls-dh-params-file
tls-ca-cert-file
tls-ca-cert-dir
tls-protocols
tls-ciphers
tls-ciphersuites
}
}
set configs
{}
set configs
{}
foreach
{
k v
}
[
r config get *
]
{
foreach
{
k v
}
[
r config get *
]
{
if
{[
lsearch $skip_configs $k
]
!= -1
}
{
if
{[
lsearch $skip_configs $k
]
!= -1
}
{
...
...
tests/unit/moduleapi/testrdb.tcl
View file @
a6504a16
...
@@ -67,6 +67,7 @@ tags "modules" {
...
@@ -67,6 +67,7 @@ tags "modules" {
}
}
# Start the replication process...
# Start the replication process...
set loglines
[
count_log_lines -1
]
$master config set repl-diskless-sync-delay 0
$master config set repl-diskless-sync-delay 0
$replica replicaof $master_host $master_port
$replica replicaof $master_host $master_port
...
@@ -76,7 +77,7 @@ tags "modules" {
...
@@ -76,7 +77,7 @@ tags "modules" {
for
{
set i 0
}
{
$i
< $attempts
}
{
incr i
}
{
for
{
set i 0
}
{
$i
< $attempts
}
{
incr i
}
{
# wait for the replica to start reading the rdb
# wait for the replica to start reading the rdb
# using the log file since the replica only responds to INFO once in 2mb
# using the log file since the replica only responds to INFO once in 2mb
wait_for_log_message -1
"*Loading DB in memory*"
5
2000 1
wait_for_log_message -1
"*Loading DB in memory*"
$loglines
2000 1
# add some additional random sleep so that we kill the master on a different place each time
# add some additional random sleep so that we kill the master on a different place each time
after
[
expr
{
int
(
rand
()
*100
)}]
after
[
expr
{
int
(
rand
()
*100
)}]
...
@@ -85,7 +86,7 @@ tags "modules" {
...
@@ -85,7 +86,7 @@ tags "modules" {
set killed
[
$master
client kill type replica
]
set killed
[
$master
client kill type replica
]
if
{[
catch
{
if
{[
catch
{
set res
[
wait_for_log_message -1
"*Internal error in RDB*"
5
100 10
]
set res
[
wait_for_log_message -1
"*Internal error in RDB*"
$loglines
100 10
]
if
{
$::verbose
}
{
if
{
$::verbose
}
{
puts $res
puts $res
}
}
...
@@ -98,6 +99,7 @@ tags "modules" {
...
@@ -98,6 +99,7 @@ tags "modules" {
$master config set repl-backlog-size
[
expr
{
16384 + $i
}]
$master config set repl-backlog-size
[
expr
{
16384 + $i
}]
}
}
# wait for loading to stop
(
fail
)
# wait for loading to stop
(
fail
)
set loglines
[
count_log_lines -1
]
wait_for_condition 100 10
{
wait_for_condition 100 10
{
[
s -1 loading
]
eq 0
[
s -1 loading
]
eq 0
}
else
{
}
else
{
...
...
tests/unit/type/incr.tcl
View file @
a6504a16
...
@@ -130,6 +130,8 @@ start_server {tags {"incr"}} {
...
@@ -130,6 +130,8 @@ start_server {tags {"incr"}} {
format $err
format $err
}
{
WRONGTYPE*
}
}
{
WRONGTYPE*
}
# On some platforms strtold
(
"+inf"
)
with valgrind returns a non-inf result
if
{
!$::valgrind
}
{
test
{
INCRBYFLOAT does not allow NaN or Infinity
}
{
test
{
INCRBYFLOAT does not allow NaN or Infinity
}
{
r set foo 0
r set foo 0
set err
{}
set err
{}
...
@@ -139,6 +141,7 @@ start_server {tags {"incr"}} {
...
@@ -139,6 +141,7 @@ start_server {tags {"incr"}} {
# there is no way to increment / decrement by infinity nor to
# there is no way to increment / decrement by infinity nor to
# perform divisions.
# perform divisions.
}
{
ERR*would produce*
}
}
{
ERR*would produce*
}
}
test
{
INCRBYFLOAT decrement
}
{
test
{
INCRBYFLOAT decrement
}
{
r set foo 1
r set foo 1
...
...
utils/generate-command-help.rb
View file @
a6504a16
...
@@ -53,7 +53,7 @@ def commands
...
@@ -53,7 +53,7 @@ def commands
require
"json"
require
"json"
require
"uri"
require
"uri"
url
=
URI
.
parse
"https://raw.githubusercontent.com/
antirez
/redis-doc/master/commands.json"
url
=
URI
.
parse
"https://raw.githubusercontent.com/
redis
/redis-doc/master/commands.json"
client
=
Net
::
HTTP
.
new
url
.
host
,
url
.
port
client
=
Net
::
HTTP
.
new
url
.
host
,
url
.
port
client
.
use_ssl
=
true
client
.
use_ssl
=
true
response
=
client
.
get
url
.
path
response
=
client
.
get
url
.
path
...
...
utils/releasetools/changelog.tcl
View file @
a6504a16
...
@@ -30,6 +30,6 @@ append template [exec git log $branch~$count..$branch "--format=format:%an in co
...
@@ -30,6 +30,6 @@ append template [exec git log $branch~$count..$branch "--format=format:%an in co
#Older, more verbose version.
#Older, more verbose version.
#
#
#append template
[
exec git log $branch~30..$branch
"--format=format:+-------------------------------------------------------------------------------%n| %s%n| By %an, %ai%n+--------------------------------------------------------------------------------%nhttps://github.com/
antirez
/redis/commit/%H%n%n%b"
--stat
]
#append template
[
exec git log $branch~30..$branch
"--format=format:+-------------------------------------------------------------------------------%n| %s%n| By %an, %ai%n+--------------------------------------------------------------------------------%nhttps://github.com/
redis
/redis/commit/%H%n%n%b"
--stat
]
puts $template
puts $template
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment