Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20519

JS tests use Random.rand() without ever setting a seed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.1.8
    • 3.3.0
    • Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • TIG E (01/08/16)

    Description

      The mongo shell will always produce the same set of random numbers if not seeded.

      $ ~/mongodb/3.1.7/mongo --nodb
      MongoDB shell version: 3.1.7
      > Random.randInt(1000000)
      242578
      > ^C
      bye
      $ ~/mongodb/3.1.7/mongo --nodb
      MongoDB shell version: 3.1.7
      > Random.randInt(1000000)
      242578
      

      Tests that use Random.rand() or Random.randInt():

      • jstests/core/geo_array2.js
      • jstests/core/geo_update_btree.js (also affects the parallel shell)
      • jstests/core/geo_update_btree2.js
      • jstests/core/remove9.js
      • jstests/core/removec.js
      • jstests/dur/manyRestart.js
      • jstests/multiVersion/mixed_storage_version_replication.js
      • jstests/noPassthrough/initial_sync_cloner_dups.js
      • jstests/noPassthroughWithMongod/indexbg_drop.js
      • jstests/noPassthroughWithMongod/mr_writeconflict.js
      • jstests/noPassthroughWithMongod/remove9.js
      • jstests/noPassthroughWithMongod/sharding_balance4.js
      • jstests/sharding/geo_shardedgeonear.js
      • jstests/slow2/remove_during_mr.js (also affects the ScopedThreads)

      Tests that use Array.shuffle():

      • aggregation/bugs/server6125.js
      • sharding/key_many.js

      Attachments

        Issue Links

          Activity

            People

              jonathan.abrahams Jonathan Abrahams
              max.hirschhorn@mongodb.com Max Hirschhorn
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: