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

Fix tiered hook functions to provide default for config string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT10.0.1, 5.1.0, 5.0.4, 4.4.10
    • Component/s: None
    • Labels:
      None

      Description

      The python tests don't necessarily provide a config string when calling session methods.  

      This shows up, for example, in some of the test_cursor12 tests that use WT_SESSION::verify.  Because verify isn't implemented (yet) on tiered tables, we have a hook function that always returns success when a test calls verify.  This fails if the test doesn't provide a config string as an argument to verify:

      $ python3 ../test/suite/run.py --hook tiered test_cursor12.test_cursor12.test_modify_smoke_recover -s 8
      ERROR in test_cursor12.test_cursor12.test_modify_smoke_recover -s 8 (table.recno.item)
      E
      ======================================================================
      ERROR: test_cursor12.test_cursor12.test_modify_smoke_recover -s 8 (table.recno.item)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/ubuntu/src/wiredtiger/test/suite/test_cursor12.py", line 337, in test_modify_smoke_recover
          self.session.verify(self.uri)
        File "/home/ubuntu/src/wiredtiger/test/suite/wthooks.py", line 192, in <lambda>
          f = lambda self, *args: hooked_function(self, orig_func, hook_info_name, *args)
        File "/home/ubuntu/src/wiredtiger/test/suite/wthooks.py", line 120, in hooked_function
          ret = call_func(self, *args)
      TypeError: <lambda>() missing 1 required positional argument: 'config'
       
      ----------------------------------------------------------------------
      Ran 1 test in 0.988s
       
      FAILED (errors=1)
      

      The fix is to provide a default value of None in the verify hook. We should do the same in all of the other hook functions, as well.

        Attachments

          Activity

            People

            Assignee:
            keith.smith Keith Smith
            Reporter:
            keith.smith Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: