@@ -44,9 +44,9 @@ struct SwitchTest : testing::Test
44
44
BT::NodeConfig simple_switch_config_;
45
45
46
46
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 ))
50
50
{
51
51
BT::PortsRemapping input;
52
52
input.insert (std::make_pair (" variable" , " {my_var}" ));
@@ -78,7 +78,7 @@ TEST_F(SwitchTest, DefaultCase)
78
78
ASSERT_EQ (NodeStatus::RUNNING, action_def.status ());
79
79
ASSERT_EQ (NodeStatus::RUNNING, state);
80
80
81
- std::this_thread::sleep_for (milliseconds (110 ));
81
+ std::this_thread::sleep_for (milliseconds (300 ));
82
82
state = root->executeTick ();
83
83
84
84
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -97,7 +97,7 @@ TEST_F(SwitchTest, Case1)
97
97
ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
98
98
ASSERT_EQ (NodeStatus::RUNNING, state);
99
99
100
- std::this_thread::sleep_for (milliseconds (110 ));
100
+ std::this_thread::sleep_for (milliseconds (300 ));
101
101
state = root->executeTick ();
102
102
103
103
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -116,7 +116,7 @@ TEST_F(SwitchTest, Case2)
116
116
ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
117
117
ASSERT_EQ (NodeStatus::RUNNING, state);
118
118
119
- std::this_thread::sleep_for (milliseconds (110 ));
119
+ std::this_thread::sleep_for (milliseconds (300 ));
120
120
state = root->executeTick ();
121
121
122
122
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -135,7 +135,7 @@ TEST_F(SwitchTest, CaseNone)
135
135
ASSERT_EQ (NodeStatus::RUNNING, action_def.status ());
136
136
ASSERT_EQ (NodeStatus::RUNNING, state);
137
137
138
- std::this_thread::sleep_for (milliseconds (110 ));
138
+ std::this_thread::sleep_for (milliseconds (300 ));
139
139
state = root->executeTick ();
140
140
141
141
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -154,7 +154,7 @@ TEST_F(SwitchTest, CaseSwitchToDefault)
154
154
ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
155
155
ASSERT_EQ (NodeStatus::RUNNING, state);
156
156
157
- std::this_thread::sleep_for (milliseconds (10 ));
157
+ std::this_thread::sleep_for (milliseconds (20 ));
158
158
state = root->executeTick ();
159
159
ASSERT_EQ (NodeStatus::RUNNING, action_1.status ());
160
160
ASSERT_EQ (NodeStatus::IDLE, action_42.status ());
@@ -163,22 +163,22 @@ TEST_F(SwitchTest, CaseSwitchToDefault)
163
163
164
164
// Switch Node does not feels changes. Only when tick.
165
165
// (not reactive)
166
- std::this_thread::sleep_for (milliseconds (10 ));
166
+ std::this_thread::sleep_for (milliseconds (20 ));
167
167
bb->set (" my_var" , " " );
168
- std::this_thread::sleep_for (milliseconds (10 ));
168
+ std::this_thread::sleep_for (milliseconds (20 ));
169
169
ASSERT_EQ (NodeStatus::RUNNING, action_1.status ());
170
170
ASSERT_EQ (NodeStatus::IDLE, action_42.status ());
171
171
ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
172
172
ASSERT_EQ (NodeStatus::RUNNING, root->status ());
173
173
174
- std::this_thread::sleep_for (milliseconds (10 ));
174
+ std::this_thread::sleep_for (milliseconds (20 ));
175
175
state = root->executeTick ();
176
176
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
177
177
ASSERT_EQ (NodeStatus::IDLE, action_42.status ());
178
178
ASSERT_EQ (NodeStatus::RUNNING, action_def.status ());
179
179
ASSERT_EQ (NodeStatus::RUNNING, state);
180
180
181
- std::this_thread::sleep_for (milliseconds (110 ));
181
+ std::this_thread::sleep_for (milliseconds (300 ));
182
182
state = root->executeTick ();
183
183
184
184
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -198,14 +198,14 @@ TEST_F(SwitchTest, CaseSwitchToAction2)
198
198
ASSERT_EQ (NodeStatus::RUNNING, state);
199
199
200
200
bb->set (" my_var" , " 42" );
201
- std::this_thread::sleep_for (milliseconds (10 ));
201
+ std::this_thread::sleep_for (milliseconds (20 ));
202
202
state = root->executeTick ();
203
203
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
204
204
ASSERT_EQ (NodeStatus::RUNNING, action_42.status ());
205
205
ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
206
206
ASSERT_EQ (NodeStatus::RUNNING, state);
207
207
208
- std::this_thread::sleep_for (milliseconds (110 ));
208
+ std::this_thread::sleep_for (milliseconds (300 ));
209
209
state = root->executeTick ();
210
210
211
211
ASSERT_EQ (NodeStatus::IDLE, action_1.status ());
@@ -226,7 +226,7 @@ TEST_F(SwitchTest, ActionFailure)
226
226
ASSERT_EQ (NodeStatus::IDLE, action_def.status ());
227
227
ASSERT_EQ (NodeStatus::RUNNING, state);
228
228
229
- std::this_thread::sleep_for (milliseconds (110 ));
229
+ std::this_thread::sleep_for (milliseconds (300 ));
230
230
state = root->executeTick ();
231
231
232
232
ASSERT_EQ (NodeStatus::FAILURE, state);
0 commit comments