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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.8
    • Fix Version/s: 3.3.0
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      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

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

                Dates

                Created:
                Updated:
                Resolved: