Reduce usage of sleep statements in jstests

XMLWordPrintableJSON

    • Server Programmability
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      sleep calls in jstests are a simple, yet often problematic way to await a change of condition. Better options exists (such as fail points, or assert.soon with some condition like $currOp), but sleep is expedient and thus often chosen. As part of SERVER-79896 I used an eslint rule to prevent future load calls, and I think we could do something similar for sleep calls. Since we can provide a custom error message, we could point server engineers to a wiki page documenting alternate strategies for waiting and hopefully influence them not to use sleep

              Assignee:
              Unassigned
              Reporter:
              Matt Broadstone
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: