Mac下安装 redis 报Test replication partial resync: ok psync (diskless: yes, reconnect: 1)

在Mac上安装redis-3.2.8时遇到编译测试错误,通过编辑tests/integration/replication-psync.tcl文件,将第100行的代码修改为500,然后重新执行`sudo make test`,可以成功解决这个问题并完成编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值