Unverified Commit a6504a16 authored by Itamar Haber's avatar Itamar Haber Committed by GitHub
Browse files

Merge branch 'unstable' into conduct

parents 91d30968 d5648d61
......@@ -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 stdout [srv $srv_idx stdout]
while {$retry} {
set result [exec tail -$last_lines < $stdout]
set result [exec tail +$from_line < $stdout]
set result [split $result "\n"]
foreach line $result {
if {[string match $pattern $line]} {
......@@ -114,7 +130,7 @@ proc wait_for_log_message {srv_idx pattern last_lines maxtries delay} {
after $delay
}
if {$retry == 0} {
fail "log message of '$pattern' not found"
fail "log message of '$pattern' not found in $stdout after line: $from_line"
}
}
......
......@@ -35,6 +35,7 @@ set ::all_tests {
unit/quit
unit/aofrw
unit/acl
unit/latency-monitor
integration/block-repl
integration/replication
integration/replication-2
......@@ -48,6 +49,7 @@ set ::all_tests {
integration/psync2
integration/psync2-reg
integration/psync2-pingoff
integration/redis-cli
unit/pubsub
unit/slowlog
unit/scripting
......
......@@ -36,7 +36,18 @@ start_server {tags {"dump"}} {
assert {$ttl >= 2900 && $ttl <= 3100}
r get foo
} {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} {
r set foo bar
set encoded [r dump foo]
......
......@@ -78,17 +78,8 @@ start_server {tags {"introspection"}} {
syslog-facility
databases
port
io-threads
tls-port
tls-prefer-server-ciphers
tls-cert-file
tls-key-file
tls-dh-params-file
tls-ca-cert-file
tls-ca-cert-dir
tls-protocols
tls-ciphers
tls-ciphersuites
io-threads
logfile
unixsocketperm
slaveof
......@@ -100,6 +91,23 @@ start_server {tags {"introspection"}} {
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 {}
foreach {k v} [r config get *] {
if {[lsearch $skip_configs $k] != -1} {
......
......@@ -67,6 +67,7 @@ tags "modules" {
}
# Start the replication process...
set loglines [count_log_lines -1]
$master config set repl-diskless-sync-delay 0
$replica replicaof $master_host $master_port
......@@ -76,7 +77,7 @@ tags "modules" {
for {set i 0} {$i < $attempts} {incr i} {
# wait for the replica to start reading the rdb
# 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
after [expr {int(rand()*100)}]
......@@ -85,7 +86,7 @@ tags "modules" {
set killed [$master client kill type replica]
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} {
puts $res
}
......@@ -98,6 +99,7 @@ tags "modules" {
$master config set repl-backlog-size [expr {16384 + $i}]
}
# wait for loading to stop (fail)
set loglines [count_log_lines -1]
wait_for_condition 100 10 {
[s -1 loading] eq 0
} else {
......
......@@ -130,15 +130,18 @@ start_server {tags {"incr"}} {
format $err
} {WRONGTYPE*}
test {INCRBYFLOAT does not allow NaN or Infinity} {
r set foo 0
set err {}
catch {r incrbyfloat foo +inf} err
set err
# p.s. no way I can force NaN to test it from the API because
# there is no way to increment / decrement by infinity nor to
# perform divisions.
} {ERR*would produce*}
# On some platforms strtold("+inf") with valgrind returns a non-inf result
if {!$::valgrind} {
test {INCRBYFLOAT does not allow NaN or Infinity} {
r set foo 0
set err {}
catch {r incrbyfloat foo +inf} err
set err
# p.s. no way I can force NaN to test it from the API because
# there is no way to increment / decrement by infinity nor to
# perform divisions.
} {ERR*would produce*}
}
test {INCRBYFLOAT decrement} {
r set foo 1
......
......@@ -53,7 +53,7 @@ def commands
require "json"
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.use_ssl = true
response = client.get url.path
......
......@@ -30,6 +30,6 @@ append template [exec git log $branch~$count..$branch "--format=format:%an in co
#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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment