Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stabilize dds tests device-init and librs-device-properties #13574

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion unit-tests/dds/device-2nd-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@


participant = dds.participant()
participant.init( 123, f'client-{log.nested.strip()}' )
# in some cases we need a bigger buffer for our messages, to avoid missing messages sent
settings = { "device" :
{ "notification" :
{ "history" :
{ "depth" : 60 }
}
}
}
participant.init( 123, f'client-{log.nested.strip()}', settings )


info = dds.message.device_info()
Expand Down
4 changes: 3 additions & 1 deletion unit-tests/dds/device-broadcaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def close_server( instance ):
Close the instance returned by broadcast_device()
"""
global servers
del servers[instance] # throws if does not exist
server = servers[instance]["server"] # throws if does not exist
server.broadcast_disconnect()
del servers[instance]


# From here down, we're in "interactive" mode (see test-device-init.py)
Expand Down
21 changes: 18 additions & 3 deletions unit-tests/dds/device-init-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@


participant = dds.participant()
participant.init( 123, "device-init-server" )
# in some cases we need a bigger buffer for our messages, to avoid missing messages sent
settings = { "device" :
{ "notification" :
{ "history" :
{ "depth" : 60 }
}
}
}
participant.init( 123, "device-init-server", settings )


def test_one_stream():
Expand Down Expand Up @@ -77,8 +85,15 @@ def notification_flooder():
i = 0
while server is not None:
i += 1
log.d( f'----> {i}' )
server.publish_notification( { 'id' : 'some-notification', 'counter' : i } )
#log.d( f'----> {i}' )
try:
server.publish_notification( { 'id' : 'some-notification', 'counter' : i } )
except AttributeError as e:
# another thread had just made the server None at this point
if not server:
log.d("tried calling publish_notification but server is None, was close_server called?")
else:
raise e # unexpected error
sleep( 0.005 )
global notification_thread
notification_thread = threading.Thread( target=notification_flooder )
Expand Down
Loading