mac 下安装 redis-3.2.8 执行 sudo make test编译的时候报如下错误
!!! WARNING The following tests failed: *** [err]: Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/integration/replication-psync.tcl Expected condition '[s -1 sync_partial_ok] > 0' to be true ([s -1 sync_partial_ok] > 0) Cleanup: may take some time... OK make[1]: *** [test] Error 1 make: *** [test] Error 2解决方法
在 redis-3.2.8 目录下
vi tests/integration/replication-psync.tcl
到代码哪个100的地方,按 i 编辑 修改为500,然后按 :wq 保存退出
test "Test replication partial resync: $descr (diskless: $diskless, reconnect: $reconnect)" { # Now while the clients are writing data, break the maste-slave # link multiple times. if ($reconnect) { for {set j 0} {$j < $duration*10} {incr j} { after 500 //原来是100 改为500 # catch {puts "MASTER [$master dbsize] keys, SLAVE [$slave dbsize] keys"} if {($j % 20) == 0} { catch { if {$delay} { $slave multi $slave client kill $master_host:$master_port $slave debug sleep $delay $slave exec } else { $slave client kill $master_host:$master_port } } } } }重新执行sudo make test 命令,编译结束后就可以看到
\o/All tests passed without errors!
Cleanup: may take some time... OK