@@ -52,7 +52,8 @@ def tearDown(self):
5252 super ().tearDown ()
5353
5454 def test_onehop_oneway_sync (self ):
55- dbl1 = sample_db .get_sample_dbl ()
55+ """ Start both DBs, insert a message in DB2, trigger_sync DB1, and check that both DBs are the same """
56+ dbl1 = sample_db .get_sample_dbl ()
5657 dbl2 = sample_db .get_sample_dbl ()
5758 dbm = db .DBMessage (1 , 1 , 2 , 1 ,
5859 rclpy .time .Time (seconds = 123 , nanoseconds = 456000000 ), bytes ('New data' , 'utf-8' ))
@@ -74,6 +75,8 @@ def test_onehop_oneway_sync(self):
7475 time .sleep (4 )
7576
7677 def test_convoluted_onehop_oneway_sync (self ):
78+ """ Start one DB1, insert a message in DB2 but don't start, trigger_sync
79+ DB1 (should be busy), start DB2, trigger_sync DB1, DBs should be the same """
7780 self .maxDiff = None
7881 dbl1 = sample_db .get_sample_dbl ()
7982 dbl2 = sample_db .get_sample_dbl ()
@@ -111,6 +114,8 @@ def test_convoluted_onehop_oneway_sync(self):
111114 time .sleep (4 )
112115
113116 def test_convoluted_onehop_twoway_sync (self ):
117+ """ Insert a message in DB1, start DB1, insert a message in DB2 but don't start, trigger_sync
118+ DB1 (should be busy), start DB2, trigger_sync DB1, DBs should be the same """
114119 self .maxDiff = None
115120 dbl1 = sample_db .get_sample_dbl ()
116121 dbl2 = sample_db .get_sample_dbl ()
@@ -196,57 +201,6 @@ def test_twohop_oneway_sync(self):
196201 time .sleep (2 )
197202
198203
199- def test_delay_run (self ):
200- self .maxDiff = None
201- db_gs = sample_db .get_sample_dbl ()
202- db_r1 = sample_db .get_sample_dbl ()
203- db_r2 = sample_db .get_sample_dbl ()
204-
205- node_gs_r1 = sync .Channel (db_gs , 'basestation' , 'charon' , self .robot_configs , 2 , self .test_ros_node )
206- node_gs_r2 = sync .Channel (db_gs , 'basestation' , 'styx' , self .robot_configs , 2 , self .test_ros_node )
207-
208- node_r1_gs = sync .Channel (db_r1 , 'charon' , 'basestation' , self .robot_configs , 2 , self .test_ros_node )
209- node_r2_gs = sync .Channel (db_r2 , 'styx' , 'basestation' , self .robot_configs , 2 , self .test_ros_node )
210-
211- node_r1_r2 = sync .Channel (db_r1 , 'charon' , 'styx' , self .robot_configs , 2 , self .test_ros_node )
212- node_r2_r1 = sync .Channel (db_r2 , 'styx' , 'charon' , self .robot_configs , 2 , self .test_ros_node )
213-
214- node_gs_r1 .run ()
215- node_gs_r2 .run ()
216-
217- dbm = db .DBMessage (1 , 1 , 2 , 1 , rclpy .time .Time (seconds = int (time .time ())), bytes ('r1_data' , 'utf-8' ))
218- db_r1 .add_modify_data (dbm )
219-
220- node_gs_r1 .trigger_sync ()
221- time .sleep (4 )
222-
223- node_r1_gs .run ()
224- node_r2_gs .run ()
225-
226- dbm = db .DBMessage (2 , 2 , 1 , 2 , rclpy .time .Time (seconds = int (time .time ())), bytes ('r2_data' , 'utf-8' ))
227- db_r2 .add_modify_data (dbm )
228-
229- node_r1_r2 .run ()
230-
231- node_r1_r2 .trigger_sync ()
232- time .sleep (4 )
233-
234- node_gs_r2 .trigger_sync ()
235- time .sleep (2 )
236-
237- node_r2_r1 .run ()
238-
239- node_gs_r1 .stop ()
240- node_r1_gs .stop ()
241-
242- node_r1_r2 .stop ()
243- node_r2_r1 .stop ()
244-
245- node_r2_gs .stop ()
246- node_gs_r2 .stop ()
247-
248- time .sleep (2 )
249-
250204 def test_delay_run (self ):
251205 self .maxDiff = None
252206 db_gs = sample_db .get_sample_dbl ()
0 commit comments