Skip to content

Commit 75cf848

Browse files
facontidavideclaude
andcommitted
Increase DeadlineTest timing margins for Windows compatibility
Windows has coarse timer resolution (~15.6ms), so the previous tight margins (20ms action, 30ms deadline = 10ms margin) were insufficient. Increased margins to: - DEADLINE_MS: 30 -> 100 - ACTION_LONG_MS: 50 -> 150 - ACTION_SHORT_MS: 20 -> 30 This gives a 70ms margin, well within Windows timer capabilities. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6dfb1d5 commit 75cf848

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/gtest_decorator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
using BT::NodeStatus;
2121
using std::chrono::milliseconds;
2222

23-
// Timing constants for faster test execution
24-
constexpr int DEADLINE_MS = 30; // Timeout threshold
23+
// Timing constants - need generous margins for Windows timer resolution (~15.6ms)
24+
constexpr int DEADLINE_MS = 100; // Timeout threshold
2525
constexpr auto ACTION_LONG_MS =
26-
milliseconds(50); // Action longer than deadline (will timeout)
26+
milliseconds(150); // Action longer than deadline (will timeout)
2727
constexpr auto ACTION_SHORT_MS =
28-
milliseconds(20); // Action shorter than deadline (will succeed)
28+
milliseconds(30); // Action shorter than deadline (will succeed)
2929

3030
struct DeadlineTest : testing::Test
3131
{

0 commit comments

Comments
 (0)