From 09ad6f909f25aef02b7f53bba320b534b9260786 Mon Sep 17 00:00:00 2001 From: Finn Williams Date: Thu, 19 Dec 2019 17:05:18 +0000 Subject: IVGCVSW-4229 Fix Intermittent failures in ExternalProfiling * Added a BufferManager.Reset() method to prevent packets being retained after a test * Fixed a bug causing the send thread to wait needlessly before moving to active state * Refactored SendCoundPacketTests and ProfilingTests test helper classes * Fixed issue where WaitForPacketSent could miss a notification and timeout Signed-off-by: Finn Williams Change-Id: I353a652260c2f7dd465baa9e979e22f50f3ca6a7 --- src/profiling/ProfilingService.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/profiling/ProfilingService.cpp') diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp index 9119597ceb..cc41fb2d69 100644 --- a/src/profiling/ProfilingService.cpp +++ b/src/profiling/ProfilingService.cpp @@ -371,6 +371,7 @@ void ProfilingService::Reset() m_CounterIndex.clear(); m_CounterValues.clear(); m_CounterDirectory.Clear(); + m_BufferManager.Reset(); // ...finally reset the profiling state machine m_StateMachine.Reset(); @@ -379,11 +380,12 @@ void ProfilingService::Reset() void ProfilingService::Stop() { // The order in which we reset/stop the components is not trivial! - - // First stop the threads (Command Handler first)... + // First stop the producing threads + // Command Handler first as it is responsible for launching then Periodic Counter capture thread m_CommandHandler.Stop(); - m_SendCounterPacket.Stop(false); m_PeriodicCounterCapture.Stop(); + // The the consuming thread + m_SendCounterPacket.Stop(false); // ...then close and destroy the profiling connection... if (m_ProfilingConnection != nullptr && m_ProfilingConnection->IsOpen()) -- cgit v1.2.1