Skip to content

Commit 205f057

Browse files
refactor: replace time.Sleep with synctest.Wait in UpdateHandler tests
1 parent d6f6daf commit 205f057

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/accesscontrol/controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,12 @@ func TestController_UpdateHandler(t *testing.T) {
243243
require.NoError(t, err)
244244

245245
// Need to wait a second before each update call so that a new history mantaray fork is created for the new key(timestamp) entry
246-
time.Sleep(1 * time.Second)
246+
synctest.Wait()
247247
beforeRevokeTS := time.Now().Unix()
248248
_, egranteeRef, hrefUpdate1, _, err := c.UpdateHandler(ctx, ls, gls, swarm.ZeroAddress, hRef, &publisher.PublicKey, addRevokeList, nil)
249249
require.NoError(t, err)
250250

251-
time.Sleep(1 * time.Second)
251+
synctest.Wait()
252252
granteeRef, _, hrefUpdate2, _, err := c.UpdateHandler(ctx, ls, gls, egranteeRef, hrefUpdate1, &publisher.PublicKey, nil, addRevokeList)
253253
require.NoError(t, err)
254254

0 commit comments

Comments
 (0)