Skip to content

Commit

Permalink
iox-#1391 Fix 'PortUser_IntegrationTest' timeout on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Nov 9, 2023
1 parent 19b7623 commit 6f6a714
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ class PortUser_IntegrationTest : public Test
++i;

/// Add some jitter to make thread breathe
std::this_thread::sleep_for(std::chrono::microseconds(100 + rand() % 50));
/// On Windows even when asked for short sleeps the OS suspends the execution for multiple milliseconds;
/// therefore lets sleep only every second iteration
if (i % 2 == 0)
{
std::this_thread::sleep_for(std::chrono::microseconds(100 + rand() % 50));
}
}
}
};
Expand Down

0 comments on commit 6f6a714

Please sign in to comment.