[SERVER-35765] distancefield_and_includelocs.js should not use exact document equality when checking output Created: 22/Jun/18  Updated: 29/Oct/23  Resolved: 04/Jul/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.1.1

Type: Bug Priority: Major - P3
Reporter: Kyle Suarez Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2018-07-02, Query 2018-07-16
Participants:
Linked BF Score: 46

 Description   

distancefield_and_includelocs.js implicitly checks that the geo distance calculated by the server is correct by asserting that the output of an aggregation pipeline is exactly the same as some expected document. However, in the shell, we compute the distance using Geo.distance() or Geo.sphereDistance(), and floating-point error can make us close-but-not-close-enough to the actual distance computed by the server.

The test should be rewritten such that we use some sort of equivalent of assert.close() on the distance field.



 Comments   
Comment by Githook User [ 04/Jul/18 ]

Author:

{'username': 'cswanson310', 'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com'}

Message: SERVER-35765 Allow small discrepancy in computed geo distances.
Branch: master
https://github.com/mongodb/mongo/commit/dd65b1675d8184bc8778ec61577fa3c81db36b88

Comment by Githook User [ 04/Jul/18 ]

Author:

{'username': 'cswanson310', 'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com'}

Message: SERVER-35765 Clean up utils.js.

This is in preparation for expanded functionality to allow for a custom
comparator.
Branch: master
https://github.com/mongodb/mongo/commit/b5b50044fc550351e0677234e55fadd0992bbe53

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