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

Fix CMake dependencies for Catch2 unit test test_sub_level_error_drop_conflict

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • WT12.0.0, 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Storage Engines, Storage Engines - Foundations
    • SE Foundations - 2025-05-09
    • 1
    • 0

      When running the Catch2 unit tests using CLion on my Macbook Pro M3 Max running MacOS 15.4.1 the following error frequently occurs:

      /Users/jeremy.thorp/Git/wiredtiger/test/catch2/sub_level_error/unit/test_sub_level_error_drop_conflict.cpp:100: Failure:
      due to unexpected exception with message:
        Error result is 2

      in 

      SECTION("Test WT_CONFLICT_DHANDLE with tiered storage")

      The error is caused by a missing dynamically loaded library, libwiredtiger_dir_store.so, that the test depends on. This library may, or may not, be available depending on how WT has been built. 

      Note, the issue was initially thought to be Mac specific, but this is not the case.

      If WT is built using 

      cmake -DHAVE_UNITTEST=1 -G "Ninja" ./..

      then libwiredtiger_dir_store.so will be built on Posix systems (including Linux & Mac), and the Catch2 tests will all pass.

      However, CLion optimises the build to build only the binaries required to run the executable (eg Catch2 unit tests) requested. The dependency for libwiredtiger_dir_store.so is missing, and so the library will not be built by default, in which case the test will fail.

      The fix is to explicitly add that dependency using CMake's add_dependencies() feature.

       

            Assignee:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Reporter:
            jeremy.thorp@mongodb.com Jeremy Thorp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: