[SERVER-45506] Add custom generated messages for assert.soon & siblings Created: 10/Jan/20  Updated: 06/Dec/22  Resolved: 10/Jan/20

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Randolph Tan Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-33034 Change assertion functions to accept ... Closed
Assigned Teams:
Sharding
Participants:

 Description   

Currently, assert.soon accepts a message as a parameter. However, the string is a fixed message that is constructed during the call to assert.soon. It would be nice to have some way of constructing helpful error messages when assert.soon timeout is triggered.

Something like this or better:

let str = "msg";
assert.soon(() => {
  str = "I changed msg";
  return false;
}, () => { return str; });



 Comments   
Comment by Randolph Tan [ 10/Jan/20 ]

Actually, it already works like I suggested

Generated at Thu Feb 08 05:08:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.