[SERVER-80141] Reduce usage of sleep statements in jstests Created: 16/Aug/23  Updated: 10/Oct/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: make-server-testing-joyful
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

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


Generated at Thu Feb 08 06:42:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.