-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.testIssues and PRs related to the tests.Issues and PRs related to the tests.
Description
- Version:
master - Platform: *
- Subsystem:
test
In some tests we want to delay or retry an async task whose exact timing for success is indeterminable.
A few option come to mind:
setTimeout(task, n)wherenis an arbitrary number that's empirically proven to be sufficient.const interval = setInterval(() => {const ret = task(); if (ret) clearInterval(interval);}), 1)do { const ret = await task()} while (ret != true)
Any other ideas or preferences?
Ref: #13252
Ref: #13312
/cc @nodejs/testing
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.testIssues and PRs related to the tests.Issues and PRs related to the tests.