{\rtf1\ansi\ansicpg1252\cocoartf2638
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f0\fs24 \cf0 diff --git a/test/cppsuite/test_harness/core/component.cxx b/test/cppsuite/test_harness/core/component.cxx\
index 05d6976ec..2abb22365 100644\
--- a/test/cppsuite/test_harness/core/component.cxx\
+++ b/test/cppsuite/test_harness/core/component.cxx\
@@ -54,7 +54,9 @@ component::run()\
 \{\
     logger::log_msg(LOG_INFO, "Running component: " + _name);\
     while (_enabled && _running) \{\
+        _done = false;\
         do_work();\
+        _done = true;\
         _throttle.sleep();\
     \}\
 \}\
diff --git a/test/cppsuite/test_harness/core/component.h b/test/cppsuite/test_harness/core/component.h\
index 65a2215cd..e39d3760a 100644\
--- a/test/cppsuite/test_harness/core/component.h\
+++ b/test/cppsuite/test_harness/core/component.h\
@@ -73,7 +73,11 @@ class component \{\
     virtual void finish();\
 \
     protected:\
+    /* Indicates the component has finished the work defined in do_work(). */\
+    bool _done = true;\
+    /* Indicates the component is enabled. */\
     bool _enabled = false;\
+    /* Indicates if the component is currently running. */\
     volatile bool _running = false;\
     throttle _throttle;\
     configuration *_config;\
diff --git a/test/cppsuite/test_harness/runtime_monitor.cxx b/test/cppsuite/test_harness/runtime_monitor.cxx\
index 122963416..3482c2539 100644\
--- a/test/cppsuite/test_harness/runtime_monitor.cxx\
+++ b/test/cppsuite/test_harness/runtime_monitor.cxx\
@@ -303,7 +303,7 @@ runtime_monitor::do_work()\
 \{\
     /* Check runtime statistics. */\
     for (const auto &stat : _stats) \{\
-        if (stat->get_runtime())\
+        if (_running && stat->get_runtime())\
             stat->check(_cursor);\
     \}\
 \}\
@@ -313,6 +313,10 @@ runtime_monitor::finish()\
 \{\
     component::finish();\
 \
+    /* We cannot proceed as long as we are using the stat cursor from the do_work() function. */\
+    while(!_done)\
+        std::this_thread::sleep_for(std::chrono::seconds(1));\
+\
     /* Save stats. */\
     save_stats(_test_name);}