Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
[Test] Removed a Windows-specific workaround.
Browse files Browse the repository at this point in the history
Replaced tabs with spaces. Removed .gitignore from the test\tmp folder and
added the test\tmp folder path to the .gitignore in the root.
  • Loading branch information
enricogior committed Nov 12, 2015
1 parent 7880e63 commit a1d0ebe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ msvs/RedisWAInst/src/RedisInstWA/app.config
msvs/jemalloc
msvs/BuildRelease
msvs/Documentation
tests/tmp/

53 changes: 23 additions & 30 deletions tests/integration/replication-psync.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ proc start_bg_complex_data {host port db ops} {
}

proc stop_bg_complex_data {handle} {
if { $::tcl_platform(platform) == "windows" } {
if { $::tcl_platform(platform) == "windows" } {
kill_proc2 $handle
} else {
catch {exec /bin/kill -9 $handle}
}
} else {
catch {exec /bin/kill -9 $handle}
}
}

# Creates a master-slave pair and breaks the link continuously to force
Expand Down Expand Up @@ -71,7 +71,6 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless rec
if {$delay} {
$slave multi
$slave client kill $master_host:$master_port

$slave debug sleep $delay
$slave exec
} else {
Expand All @@ -94,28 +93,28 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless rec
if {[$master debug digest] ne [$slave debug digest]} {
set csv1 [csvdump r]
set csv2 [csvdump {r -1}]
if { $::tcl_platform(platform) == "windows" } {
set tmpdir $::env(TEMP)
set fd [open [file join $tmpdir repldump1.txt] w]
} else {
set fd [open /tmp/repldump1.txt w]
}
if { $::tcl_platform(platform) == "windows" } {
set tmpdir $::env(TEMP)
set fd [open [file join $tmpdir repldump1.txt] w]
} else {
set fd [open /tmp/repldump1.txt w]
}

puts -nonewline $fd $csv1
close $fd
if { $::tcl_platform(platform) == "windows" } {
set fd [open [file join $tmpdir repldump2.txt] w]
} else {
set fd [open /tmp/repldump2.txt w]
}
if { $::tcl_platform(platform) == "windows" } {
set fd [open [file join $tmpdir repldump2.txt] w]
} else {
set fd [open /tmp/repldump2.txt w]
}
puts -nonewline $fd $csv2
close $fd
puts "Master - Slave inconsistency"
if { $::tcl_platform(platform) == "windows" } {
puts "Run fc against repldump*.txt in $tmpdir for more info"
} else {
puts "Run diff -u against /tmp/repldump*.txt for more info"
}
if { $::tcl_platform(platform) == "windows" } {
puts "Run fc against repldump*.txt in $tmpdir for more info"
} else {
puts "Run diff -u against /tmp/repldump*.txt for more info"
}
}
assert_equal [r debug digest] [r -1 debug digest]
eval $cond
Expand All @@ -136,17 +135,11 @@ foreach diskless {no yes} {
assert {[s -1 sync_partial_err] > 0}
} $diskless 1

if { $::tcl_platform(platform) == "windows" } {
set delay 6
} else {
set delay 3
}

test_psync {ok after delay} $delay 100000000 3600 3 {
test_psync {ok after delay} 3 100000000 3600 3 {
assert {[s -1 sync_partial_ok] > 0}
} $diskless 1

test_psync {backlog expired} $delay 100000000 1 3 {
test_psync {backlog expired} 3 100000000 1 3 {
assert {[s -1 sync_partial_err] > 0}
} $diskless 1
}
1 change: 0 additions & 1 deletion tests/tmp/.gitignore

This file was deleted.

0 comments on commit a1d0ebe

Please sign in to comment.