Skip to content

Commit

Permalink
add prints to the test
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Jan 13, 2025
1 parent 7c71487 commit f42b7ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions unit-tests/dds/test-device-discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ def create_server_2( root ):
broadcast_devices = []
def on_device_info_available( reader ):
while True:
print( " *** on_device_info_available taking next message" )
msg = dds.message.flexible.take_next( reader )
print( " *** on_device_info_available take_next returned" )
if not msg:
break
j = msg.json_data()
log.d( f'on_device_info_available {j}' )
global broadcast_devices
broadcast_devices.append( j )
print( " *** on_device_info_available setting event" )
broadcast_received.set()
device_info.on_data_available( on_device_info_available )
device_info.run( dds.topic_reader.qos() )
Expand Down Expand Up @@ -109,6 +112,7 @@ def __init__( self, n_expected=1, timeout=1 ):
def __enter__( self ):
detect_broadcast()
def __exit__( self, type, value, traceback ):
print( " *** broadcast_expected exiting ")
if type is None: # If an exception is thrown, don't do anything
wait_for_broadcast( count=self._n_expected, timeout=self._timeout )

Expand Down Expand Up @@ -202,8 +206,11 @@ def __exit__( self, type, value, traceback ):
with broadcast_expected( 2 ):
reader_2 = dds.topic_reader( device_info_topic )
reader_2.run( dds.topic_reader.qos() )
print( " *** reader_2 running ")
test.check_equal( len(broadcast_devices), 2 )
print( " *** deleting reader_2")
del reader_2
print( " *** deleting reader_2 done")

#############################################################################################
with test.closure( "We should see both in the watcher" ):
Expand Down

0 comments on commit f42b7ce

Please sign in to comment.