Skip to content

Commit

Permalink
fix(tests): fixed keepalive test
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi committed Apr 20, 2024
1 parent b977aa1 commit ec222e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mutext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ func TestRenew(t *testing.T) {
{
name: "keepalive_should_work",
run: func(r *require.Assertions) {
ttl := 2 * time.Second
m := New("renew", "wallet", "renew_keepalive", WithPeers(peers...), WithTTL(ttl), WithKeepAlive(1*time.Second))
ttl := 3 * time.Second
m := New("renew", "wallet", "renew_keepalive",
WithPeers(peers...),
WithTTL(ttl),
WithKeepAlive(1*time.Second))
err := m.Lock(context.TODO())

r.NoError(err)
Expand All @@ -234,7 +237,7 @@ func TestRenew(t *testing.T) {

go m.Keepalive()

time.Sleep(ttl)
time.Sleep(ttl + 1*time.Second)

err = m.Renew(context.TODO())
r.NoError(err)
Expand Down

0 comments on commit ec222e9

Please sign in to comment.