Skip to content

Commit

Permalink
iox-eclipse-iceoryx#751 Replace units::Duration::max() so that MacOS …
Browse files Browse the repository at this point in the history
…semaphore platform does not overflow

Signed-off-by: Christian Eltzschig <me@elchris.org>
  • Loading branch information
elfenpiff committed May 23, 2022
1 parent 73bb9cc commit fee00c9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ TYPED_TEST(SemaphoreInterfaceTest, TimedWaitBlocksAtLeastDefinedUntilTriggeredAn
auto start = std::chrono::steady_clock::now();
counter = 2;

auto result = this->sut->timedWait(iox::units::Duration::max());
/// As time units::Duration::max() would be a better fit but this causes an overflow
/// in the internal MacOS semaphore platform implementation. This is a good compromise
/// for a long wait time which will be interrupted by sut->post in thread t1
auto result = this->sut->timedWait(this->TIMING_TEST_WAIT_TIME * 100);
auto end = std::chrono::steady_clock::now();

ASSERT_FALSE(result.has_error());
Expand Down

0 comments on commit fee00c9

Please sign in to comment.