Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4944

Insufficient testing for limit functionality

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.2.0.rc1, 7.1.4, 7.0.10, 6.4.7
    • Component/s: None
    • Labels:
      None

      Description

      Currently, Mongoid's tests for QueryCache functionality when queries with different limits are executed are insufficient, since the collections are empty and therefore don't test if the correct amount of documents are being returned if the cache is used. 

      I don't believe the functionality is correct because in the case shown below, when the cache is used all of the stored cached_documents will still be iterated, not a limited subset of them. The QueryCache in driver should return the correct documents. 

      It is my understanding that the code on lines 250-252 of the cached_cursor method are unnecessary and should be removed, similar to the driver's implementation.

        Attachments

        1. cached_cursor method.png
          cached_cursor method.png
          101 kB
        2. mongoid tests.png
          mongoid tests.png
          120 kB

          Activity

            People

            Assignee:
            emily.giurleo Emily Giurleo (Inactive)
            Reporter:
            grace.chong Grace Chong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: