[GODRIVER-2117] Clean up executeTestRunnerOperation Created: 05/Aug/21  Updated: 10/Nov/23  Resolved: 08/Nov/23

Status: Closed
Project: Go Driver
Component/s: Testing
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Bug Priority: Trivial - P5
Reporter: Benji Rewis (Inactive) Assignee: Steve Silvester
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Documentation Changes: Not Needed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Summary

executeTestRunnerOperation in mongo/integration/unified_spec_test (the old unified spec runner) often checks fields of clientSession without checking if clientSession itself is nil. This could cause a panic if a test is malformed (unlikely) and has a session-related operation but no specified session. Would be good practice to add an assert.NotNil before each of these checks.

This method also switches back and forth between using assert calls and just returning errors to the caller (runOperation). We should just return errors so that the error chain is obvious in test debugging.

Motivation

Who is the affected end user?

Go driver devs.

How does this affect the end user?

Not at all.

How likely is it that this problem or use case will occur?

Unlikely.

If the problem does occur, what are the consequences and how severe are they?

Possible bug in test runner/.

Is this issue urgent?

No.

Is this ticket required by a downstream team?

No.

Is this ticket only for tests?

Yes.



 Comments   
Comment by Githook User [ 10/Nov/23 ]

Author:

{'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}

Message: GODRIVER-2117 Cherry-pick legacy test runner error handling (#1466)

Co-authored-by: Lokesh Kumar <lkumar94@gmail.com>
Branch: release/1.13
https://github.com/mongodb/mongo-go-driver/commit/1e4eb9422b9923a95f3bf7b133cf6c7a25696a0a

Comment by Githook User [ 08/Nov/23 ]

Author:

{'name': 'Steven Silvester', 'email': 'steven.silvester@ieee.org', 'username': 'blink1073'}

Message: GODRIVER-2117 [master] - Check clientSession is not nil inside executeTestRunnerOperation (#1461)

Co-authored-by: Lokesh Kumar <lkumar94@gmail.com>
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/d1a66ce53410faa2a646362a37de45605a75c57d

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