@@ -44,9 +44,9 @@ struct SwitchTest : testing::Test
4444 BT::NodeConfig simple_switch_config_;
4545
4646 SwitchTest () :
47- action_1(" action_1" , milliseconds(100 )),
48- action_42(" action_42" , milliseconds(100 )),
49- action_def(" action_default" , milliseconds(100 ))
47+ action_1(" action_1" , milliseconds(200 )),
48+ action_42(" action_42" , milliseconds(200 )),
49+ action_def(" action_default" , milliseconds(200 ))
5050 {
5151 BT::PortsRemapping input;
5252 input.insert (std::make_pair (" variable" , " {my_var}" ));
@@ -78,7 +78,7 @@ TEST_F(SwitchTest, DefaultCase)
7878 ASSERT_EQ (NodeStatus::RUNNING, action_def.status ());
7979 ASSERT_EQ (NodeStatus::RUNNING, state);
8080
81- std::this_thread::sleep_for (milliseconds (110 ));
81+ std::this_thread::sleep_for (milliseconds (300 ));
8282 state = root->executeTick ();
8383
8484 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -97,7 +97,7 @@ TEST_F(SwitchTest, Case1)
9797 ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
9898 ASSERT_EQ (NodeStatus::RUNNING, state);
9999
100- std::this_thread::sleep_for (milliseconds (110 ));
100+ std::this_thread::sleep_for (milliseconds (300 ));
101101 state = root->executeTick ();
102102
103103 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -116,7 +116,7 @@ TEST_F(SwitchTest, Case2)
116116 ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
117117 ASSERT_EQ (NodeStatus::RUNNING, state);
118118
119- std::this_thread::sleep_for (milliseconds (110 ));
119+ std::this_thread::sleep_for (milliseconds (300 ));
120120 state = root->executeTick ();
121121
122122 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -135,7 +135,7 @@ TEST_F(SwitchTest, CaseNone)
135135 ASSERT_EQ (NodeStatus::RUNNING, action_def.status ());
136136 ASSERT_EQ (NodeStatus::RUNNING, state);
137137
138- std::this_thread::sleep_for (milliseconds (110 ));
138+ std::this_thread::sleep_for (milliseconds (300 ));
139139 state = root->executeTick ();
140140
141141 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -154,7 +154,7 @@ TEST_F(SwitchTest, CaseSwitchToDefault)
154154 ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
155155 ASSERT_EQ (NodeStatus::RUNNING, state);
156156
157- std::this_thread::sleep_for (milliseconds (10 ));
157+ std::this_thread::sleep_for (milliseconds (20 ));
158158 state = root->executeTick ();
159159 ASSERT_EQ (NodeStatus::RUNNING, action_1.status ());
160160 ASSERT_EQ (NodeStatus::IDLE, action_42.status ());
@@ -163,22 +163,22 @@ TEST_F(SwitchTest, CaseSwitchToDefault)
163163
164164 // Switch Node does not feels changes. Only when tick.
165165 // (not reactive)
166- std::this_thread::sleep_for (milliseconds (10 ));
166+ std::this_thread::sleep_for (milliseconds (20 ));
167167 bb->set (" my_var" , " " );
168- std::this_thread::sleep_for (milliseconds (10 ));
168+ std::this_thread::sleep_for (milliseconds (20 ));
169169 ASSERT_EQ (NodeStatus::RUNNING, action_1.status ());
170170 ASSERT_EQ (NodeStatus::IDLE, action_42.status ());
171171 ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
172172 ASSERT_EQ (NodeStatus::RUNNING, root->status ());
173173
174- std::this_thread::sleep_for (milliseconds (10 ));
174+ std::this_thread::sleep_for (milliseconds (20 ));
175175 state = root->executeTick ();
176176 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
177177 ASSERT_EQ (NodeStatus::IDLE, action_42.status ());
178178 ASSERT_EQ (NodeStatus::RUNNING, action_def.status ());
179179 ASSERT_EQ (NodeStatus::RUNNING, state);
180180
181- std::this_thread::sleep_for (milliseconds (110 ));
181+ std::this_thread::sleep_for (milliseconds (300 ));
182182 state = root->executeTick ();
183183
184184 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -198,14 +198,14 @@ TEST_F(SwitchTest, CaseSwitchToAction2)
198198 ASSERT_EQ (NodeStatus::RUNNING, state);
199199
200200 bb->set (" my_var" , " 42" );
201- std::this_thread::sleep_for (milliseconds (10 ));
201+ std::this_thread::sleep_for (milliseconds (20 ));
202202 state = root->executeTick ();
203203 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
204204 ASSERT_EQ (NodeStatus::RUNNING, action_42.status ());
205205 ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
206206 ASSERT_EQ (NodeStatus::RUNNING, state);
207207
208- std::this_thread::sleep_for (milliseconds (110 ));
208+ std::this_thread::sleep_for (milliseconds (300 ));
209209 state = root->executeTick ();
210210
211211 ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -226,7 +226,7 @@ TEST_F(SwitchTest, ActionFailure)
226226 ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
227227 ASSERT_EQ (NodeStatus::RUNNING, state);
228228
229- std::this_thread::sleep_for (milliseconds (110 ));
229+ std::this_thread::sleep_for (milliseconds (300 ));
230230 state = root->executeTick ();
231231
232232 ASSERT_EQ (NodeStatus::FAILURE, state);
0 commit comments