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

Fix suite_random.rand32() in python test suite

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: