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

Random seed based tests are not deterministic on windows

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.1.1
    • None
    • Testing Infrastructure
    • None
    • Windows

    Description

      On windows the random seed is not used

              BSONObj JSRand( const BSONObj &a, void* data ) {
                  uassert( 12519, "rand accepts no arguments", a.nFields() == 0 );
                  unsigned r;
      #if !defined(_WIN32)
                  r = rand_r( &_randomSeed );
      #else
                  r = rand(); // seed not used in this case
      #endif
                  return BSON( "" << double( r ) / ( double( RAND_MAX ) + 1 ) );
              }

      Attachments

        Activity

          People

            tad Tad Marshall
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: