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

Stop the tracking component when a CPP test ends

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT10.0.1, 5.0.4, 4.4.10, 5.2.0, 5.1.0-rc0
    • Component/s: None
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      Storage - Ra 2021-10-18

      Description

      The workload_tracking component keeps running while the test has finished when the tracking table gets big. We should check for _running in the while loop.

       

      Reproducing the issue
      Set the test duration to 10s:

      --- a/test/cppsuite/configs/base_test_default.txt
      +++ b/test/cppsuite/configs/base_test_default.txt
      @@ -1,5 +1,5 @@
       # Used as a base test for the framework.
      -duration_seconds=60,
      +duration_seconds=10,
       cache_size_mb=200,
       enable_logging=true,
       checkpoint_manager= 

      Run the following command to execute base_test:

      ./run -t base_test -l 3 

      The test should take more than 10s to finish because the workload tracking component keeps doing work.

      Suggested changes

      diff --git a/test/cppsuite/test_harness/workload/workload_tracking.cxx b/test/cppsuite/test_harness/workload/workload_tracking.cxx
      index 1211749ec..c68010967 100644
      --- a/test/cppsuite/test_harness/workload/workload_tracking.cxx
      +++ b/test/cppsuite/test_harness/workload/workload_tracking.cxx
      @@ -99,7 +99,7 @@ workload_tracking::do_work()
           /* Take a copy of the oldest so that we sweep with a consistent timestamp. */
           oldest_ts = _tsm.get_oldest_ts();
       
      -    while ((ret = _sweep_cursor->prev(_sweep_cursor.get())) == 0) {
      +    while (_running && (ret = _sweep_cursor->prev(_sweep_cursor.get())) == 0) {
               testutil_check(_sweep_cursor->get_key(_sweep_cursor.get(), &collection_id, &key, &ts));
               testutil_check(_sweep_cursor->get_value(_sweep_cursor.get(), &op_type, &value));
      @@ -137,10 +137,6 @@ workload_tracking::do_work()
       
           free(sweep_key);
       
      -    if (ret != WT_NOTFOUND)
      -        testutil_die(LOG_ERROR,
      -          "Tracking table sweep failed: cursor->next() returned an unexpected error %d.", ret);
      -

      Definition of done:

      All cpp tests are OK

        Attachments

          Activity

            People

            Assignee:
            etienne.petrel Etienne Petrel
            Reporter:
            etienne.petrel Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: