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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.0
    • Affects Version/s: 3.1.8
    • Component/s: Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • TIG E (01/08/16)

      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

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

              Created:
              Updated:
              Resolved: