disagg: Fix tests that fail in is_layered() check

XMLWordPrintableJSON

    • Storage Engines - Foundations
    • None
    • None

      We have several python tests failing with the disagg hook because spawned threads are created without a reference to the current test case, which is needed for several hook functions including is_layered():

      def is_layered(uri):
          testcase = WiredTigerTestCase.getCurrentTestCase()
          return uri in testcase.layered_uris 

      If an API call is made from within a spawned thread, calls to is_layered() will fail as the returned testcase will be None.

      Repro:

      $ python3 ../test/suite/run.py -p -v 4 --hook disagg test_prepare28
      [pid:55452]: Traceback (most recent call last):
        File "/home/ubuntu/wiredtiger/test/suite/wttest.py", line 161, in wrapper
          return func(self, *args, **kwargs)
        File "/home/ubuntu/wiredtiger/test/suite/wttest.py", line 692, in tearDown
          self.captureerr.check(self)
        File "/home/ubuntu/wiredtiger/test/suite/../py_utility/abstract_test_case.py", line 174, in check
          testcase.fail('unexpected ' + self.desc + ', contains: "' +
      AssertionError: unexpected error output, contains: "Exception in thread Thread-1 (read_update):
      Traceback (most recent call last):
        File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
          self.run()
        File "/usr/lib/python3.10/threading.py", line 953, in run
          self._target(*self._args, **self._kwargs)
        File "/home/ubuntu/wiredtiger/test/suite/test_prepare28.py", line 66, in read_update
          cursor = session.open_cursor(self.uri)
        File "/home/ubuntu/wiredtiger/test/suite/wthooks.py", line 204, in <lambda>
          f = lambda self, *args: hooked_function(self, orig_func, hook_info_name, *args)
        File "/home/ubuntu/wiredtiger/test/suite/wthooks.py", line 127, in hooked_function
          ret = call_func(self, *args)
        File "/home/ubuntu/wiredtiger/test/suite/hook_disagg.py", line 408, in <lambda>
          session_open_cursor_replace(orig_session_open_cursor, s, uri, todup, config))
        File "/home/ubuntu/wiredtiger/test/suite/hook_disagg.py", line 313, in session_open_cursor_replace
          if is_layered(uri) and config != None:
        File "/home/ubuntu/wiredtiger/test/suite/hook_disagg.py", line 200, in is_layered
          return uri in testcase.layered_uris
      AttributeError: 'NoneType' object has no attribute 'layered_uris' 

      This ticket is to ensure all test cases that spawn new threads initialize them with a reference to the current test case. 

      Related failing tests:

      • test_prepare28.py
      • test_error_info03.py
      • test_hs24.py
      • test_hs_evict_race01.py

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Alexander Pullen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: