-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Fully Compatible
-
ALL
-
Service Arch 2021-05-17
-
0
It is unsafe to assert from the spawned threads in unit-tests, as such assertions are process fatal. We should change the assertions in thread_context_test (e.g., here) to be thread-safe. This could be done by using the ThreadAssertionMonitor.
Moreover, the spawned threads could access non-thread safe metrics (shown below) that are defined here. Accessing these metrics must be serialized (e.g., by using atomics or a mutex) to ensure thread-safety.
class ThreadContextTest : public unittest::Test { ... private: size_t _created; size_t _destroyed; size_t _destroyedOffThread; };