[SERVER-41276] .aggregate() helper doesn't preserve writeConcern information for tests Created: 22/May/19  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Aggregation Framework, Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

When the writeConcern fails it will still report to the user this error:

 
2019-05-22T13:56:50.312-0400 E  QUERY    [js] uncaught exception: Error: command failed: {2019-05-22T13:56:50.312-0400 E  QUERY    [js] uncaught exception: Error: command failed: { "cursor" : { "firstBatch" : [ ], "id" : NumberLong(0), "ns" : "test.foo" }, "writeConcernError" : { "code" : 64, "codeName" : "WriteConcernFailed", "errmsg" : "waiting for replication timed out", "errInfo" : { "wtimeout" : true } }, "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1558547805, 1), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }, "operationTime" : Timestamp(1558547805, 1)} : aggregate failed :_getErrorWithCode@src/mongo/shell/utils.js:25:13doassert@src/mongo/shell/assert.js:18:14_assertCommandWorked@src/mongo/shell/assert.js:584:17assert.commandWorked@src/mongo/shell/assert.js:674:16DB.prototype._runAggregate@src/mongo/shell/db.js:262:9DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1004:12 

However, in a test the error thrown will not have any properties we can expect to verify that the command failed for the expected reason. 


Generated at Thu Feb 08 04:57:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.