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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON, Performance
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Michael Baldry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 1 week
                1w
                Remaining:
                Remaining Estimate - 1 week
                1w
                Logged:
                Time Spent - Not Specified
                Not Specified