Skip to content

Commit

Permalink
iox-eclipse-iceoryx#495 add watchdog to mutext_test
Browse files Browse the repository at this point in the history
Signed-off-by: Dietrich Krönke <[email protected]>
  • Loading branch information
dkroenke authored and marthtz committed May 12, 2021
1 parent 04012b0 commit 6ffcb97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iceoryx_utils/test/moduletests/test_posix_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "iceoryx_utils/cxx/deadline_timer.hpp"
#include "iceoryx_utils/internal/posix_wrapper/mutex.hpp"
#include "test.hpp"
#include "testutils/watch_dog.hpp"

#include <atomic>
#include <thread>
Expand All @@ -31,6 +32,7 @@ class Mutex_test : public Test
void SetUp() override
{
internal::CaptureStderr();
m_deadlockWatchdog.watchAndActOnFailure([] { std::terminate(); });
}

void TearDown() override
Expand All @@ -44,6 +46,8 @@ class Mutex_test : public Test

iox::posix::mutex sutNonRecursive{false};
iox::posix::mutex sutRecursive{true};
iox::units::Duration m_watchdogTimeout = 5_s;
Watchdog m_deadlockWatchdog{m_watchdogTimeout};
};

TEST_F(Mutex_test, TryLockWithNoLock)
Expand Down

0 comments on commit 6ffcb97

Please sign in to comment.