Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-6996

Fix suite_random.rand32() in python test suite

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.0, 4.9.0, 4.4.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 3
    • Storage - Ra 2020-12-28, Storage - Ra 2021-01-11

      The suite_random.rand32() function has a bug that means it will only return values < 2^16, not 2^32.  Here's a suggested fix:

      diff --git a/test/suite/suite_random.py b/test/suite/suite_random.py
      old mode 100644
      new mode 100755
      index 4ae8691de..f329dd8ca
      --- a/test/suite/suite_random.py
      +++ b/test/suite/suite_random.py
      @@ -59,7 +59,7 @@ class suite_random:
       
               self.seedz = (36969 * (z & 65535) + (z >> 16)) & 0xffffffff
               self.seedw = (18000 * (w & 65535) + (w >> 16)) & 0xffffffff
      -        return ((z << 16) + w & 65535) & 0xffffffff
      +        return ((z << 16) + (w & 65535)) & 0xffffffff
       
           def rand_range(self, n, m):
               """ 

      This may cause tests to run differently, so might expose other issues. It might be looked at along with WT-6981.

            Assignee:
            jie.chen@mongodb.com Jie Chen
            Reporter:
            donald.anderson@mongodb.com Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: