Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-3350

BSON::ObjectId not generating in order when in a loop

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON, Performance
    • None

      I'm not 100% sure this is the right place, but the github for bson-ruby doesn't accept issues and there is no category for it in Jira that I could find.

       

      Executing the following:

      1. sanity check
        x = 10.times.map { BSON::ObjectId.new }
        raise "sanity check failed" if x != x.sort
      1. test
        100.times do
        x = 10.times.map { BSON::ObjectId.new }
        if x != x.sort
        puts "FAIL"
        else
        puts "PASS"
        end
        end
        it always prints 100 "FAIL" but the sanity check never fails. How can this be?

      Am I misunderstanding something?

            Assignee:
            dmitry.rybakov@mongodb.com Dmitry Rybakov
            Reporter:
            michael.baldry@silkfred.com Michael Baldry
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: