Skip to content

Commit

Permalink
test: the CPU may be slow, need to wait a long time.
Browse files Browse the repository at this point in the history
  • Loading branch information
membphis committed Jun 3, 2019
1 parent 8e2954e commit da7c53a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions t/key.t
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ checked val as expect: abc
local res2, err = etcd:wait("/test", res.body.node.modifiedIndex + 1, 1)
ngx.say("err: ", err, ", more than 1sec: ", ngx.now() - cur_time > 1)

ngx.timer.at(1, function ()
ngx.timer.at(1.5, function ()
etcd:set("/test", "bcd")
end)

cur_time = ngx.now()
res, err = etcd:wait("/test", res.body.node.modifiedIndex + 1, 5)
res, err = etcd:wait("/test", res.body.node.modifiedIndex + 1, 3)
check_res(res, err, "bcd")
ngx.say("wait more than 1sec: ", ngx.now() - cur_time > 1)
}
Expand All @@ -246,6 +246,7 @@ checked val as expect: abc
err: timeout, more than 1sec: true
checked val as expect: bcd
wait more than 1sec: true
--- timeout: 5



Expand Down

0 comments on commit da7c53a

Please sign in to comment.