Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80141

Reduce usage of sleep statements in jstests

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Service Arch

      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:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: