aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaneil01 <jan.eilers@arm.com>2019-12-03 17:01:32 +0000
committerjaneil01 <jan.eilers@arm.com>2019-12-03 17:07:37 +0000
commit811ca5566ac4a166fb4d8d8ee4f235dda59b1eab (patch)
tree40dc5235d979efa4bf7083075a185674ca02e8fc
parent167c08296bff79606d1ec98b740e9ce24fa33e43 (diff)
downloadarmnn-811ca5566ac4a166fb4d8d8ee4f235dda59b1eab.tar.gz
IVGCVSW-4171 Fix intermittent failure on FileOnlyProfilingDecoratorTests
* Added destructor to prevent hanging after raising an error * Enhanced timeouts to prevent test from failing Signed-off-by: janeil01 <jan.eilers@arm.com> Change-Id: Ibf137835040edc51348d70ff67d27ef3fffac15b
-rw-r--r--src/profiling/ProfilingService.cpp6
-rw-r--r--src/profiling/ProfilingService.hpp2
-rw-r--r--src/profiling/test/FileOnlyProfilingDecoratorTests.cpp6
3 files changed, 10 insertions, 4 deletions
diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp
index c4063a583c..ddd4d80b06 100644
--- a/src/profiling/ProfilingService.cpp
+++ b/src/profiling/ProfilingService.cpp
@@ -90,6 +90,7 @@ void ProfilingService::Update()
switch (currentState)
{
case ProfilingState::Uninitialised:
+
// Initialize the profiling service
Initialize();
@@ -368,6 +369,11 @@ inline void ProfilingService::CheckCounterUid(uint16_t counterUid) const
}
}
+ProfilingService::~ProfilingService()
+{
+ Stop();
+}
+
} // namespace profiling
} // namespace armnn
diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp
index f9b057c68b..dd75d053c9 100644
--- a/src/profiling/ProfilingService.hpp
+++ b/src/profiling/ProfilingService.hpp
@@ -179,7 +179,7 @@ protected:
// Register the "Per-Job Counter Selection" command handler
m_CommandHandlerRegistry.RegisterFunctor(&m_PerJobCounterSelectionCommandHandler);
}
- ~ProfilingService() = default;
+ ~ProfilingService();
// Protected methods for testing
void SwapProfilingConnectionFactory(ProfilingService& instance,
diff --git a/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp b/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp
index d4907b6365..b30b38f2e4 100644
--- a/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp
+++ b/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp
@@ -45,8 +45,8 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFileEndToEnd)
profilingService.Update();
profilingService.Update();
- uint32_t timeout = 25; // Wait for a maximum of 25mSec
- uint32_t sleepTime = 1; // in 1mSec intervals.
+ uint32_t timeout = 1000; // Wait for a maximum of 1000mSec
+ uint32_t sleepTime = 2; // in 2mSec intervals.
uint32_t timeSlept = 0;
// Give the profiling service sending thread time start executing and send the stream metadata.
@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(DumpOutgoingValidFileEndToEnd)
options.m_EnableProfiling = false;
profilingService.ResetExternalProfilingOptions(options, true);
// Wait a short time to allow the threads to clean themselves up.
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ std::this_thread::sleep_for(std::chrono::milliseconds(500));
// The output file size should be greater than 0.
struct stat statusBuffer;