[DRIVERS-2641] Allow int32 or int64 for cursor ID in getMore commandStartedEvent assertions Created: 31/May/23  Updated: 28/Oct/23  Resolved: 05/Jun/23

Status: Closed
Project: Drivers
Component/s: Client Side Encryption, Load Balancer, Unified Test Runner
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to PHPLIB-1156 Sync various spec tests for flexible ... Closed
Driver Changes: Not Needed
Downstream Changes Summary:

Sync legacy CSFLE spec tests, unified load balancer tests, and "valid-pass" unified spec test with mongodb/specifications@2a51e98.

Driver Compliance:
Key Status/Resolution FixVersion
PHPLIB-1156 Fixed 1.16.0

 Description   

Summary

I noticed that a handful of spec tests (both legacy and unified) only expect an int64 BSON type for the cursor ID in an observed getMore command. The vast majority of specs use a flexible assertion that allows int32 or int64 to accommodate drivers that encode BSON integers in the smallest possible type depending on its value.

Instead of:

getMore: { $$type: long }

Tests should use:

getMore: { $$type: [ int, long ] }

Motivation

Who is the affected end user?

Drivers that may conditionally encode integers as int32 or int64, range permitting.

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

Rare. Cursor IDs are usually greater than INT32_MAX.

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

Possible test failure.

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 [ 01/Jun/23 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: DRIVERS-2641: Allow int32 or int64 for getMore cursor ID (#1427)

This accommodate drivers that encode BSON integers according to their range and is consistent with what is done in most other spec tests.
Branch: master
https://github.com/mongodb/specifications/commit/2a51e9827a10e61617b1c34c53377edeed0f6a7b

Comment by Jeremy Mikola [ 31/May/23 ]

https://github.com/mongodb/specifications/pull/1427

Comment by Jeremy Mikola [ 31/May/23 ]

Note: I intentionally did not require driver changes for this issue to avoid spawning language tickets. It's unlikely that most drivers are affected by this issue so drivers can pull in these changes when syncing other changes for the affected specs.

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