fix: wait for req socket send to make sure we dont stay stuck - if there's no... #23
Reference in New Issue
Block a user
Delete Branch "feat/cb2ui-robot-connections"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using a branch of UI which shows whether the robot is connected, we want to inform the UI of our connectivity using and show these on the UI.
This is done with the use of ri_communication_agent and the robot endpoint in the router.
In order to complete this merge, follow steps and mark the checklist:
sudo prodactl adduser {name@localhost}with password {name}.uv syncandnpm i.uv run --group integration-test pytest test/integration --cov=src --cov-report=term-missingshow that all test pass and that/robot.pyhas 100% coverage, with the agents having 86 and 91% coverage respectively.uv run --only-group test pytest test/unitshow that all test passruff checkshows that 'All checks passed!'.ruff formatshows that all files have been left unchanged.Connected Robotspage shows whether the robot is currently connected (should be true)Code Style Guides.Additional comments:
There is also a merge request for the UI side. Feel free to choose which one to merge first. Let me know if there is any additional changed needed to be made before this merge can be finalized.
assigned to @9828273
You say let's check, but it appears like you don't actually do anything with this timeout?
Is this really an
error, or should it be awarning?This should not be an
error.Should you maybe sleep here for some time after each iteration? This loop will finish ridiculously fast.
This
timeoutis 1, but later you say no connection in 20 seconds. Maybe change the later appearance if you want this to be 1.A lot of these errors should be handled more gracefully. We shouldn't be crashing the program because the RICommunicationAgent failed to establish connection a couple of times
I checked it, can remove the TODO :)
You should probably make this endpoint /ping/stream, and make the above (not implemented yet) /ping. That way there is an intuitive way to either request the current ping with /ping, or request a stream of pings with /ping/stream
This sleep is unnecessary
I don't know if this log is necessary
Better not to test for log messages, only for program behavior.
requested changes
marked the checklist item This branch is up to date with dev as completed
marked the checklist item
uv run --group integration-test pytest test/integration --cov=src --cov-report=term-missingshow that all test pass and that/robot.pyhas 100% coverage, with the agents having 86 and 91% coverage respectively. as completedmarked the checklist item
uv run --only-group test pytest test/unitshow that all test pass as completedmarked the checklist item
ruff checkshows that 'All checks passed!'. as completedmarked the checklist item
ruff formatshows that all files have been left unchanged. as completedThe timeout is just for debugging- due to REQ/REP behavior both sending and receiving on REQ would be blocked without any receiver. The 'real' check is the await_for, immediately after. You could remove this, but in edge cases where sockets are throttled this could help give insight:)
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
changed this line in version 2 of the diff
added 1 commit
debc87c0- fix: Fix up merging request changes and make sure that there is no racing...Compare with previous version
marked the checklist item First starting the CB, then starting the RI to connect, and finally launching the UI, the
Connected Robotspage shows whether the robot is currently connected (should be true) as completedadded 1 commit
41993a90- chore: remove caplog from test casesCompare with previous version
added 1 commit
2eefcc45- chore: fix error messages to be warnings.Compare with previous version
Will be for later- not needed yet, as there's no need for a 'one time request ping' as of right now.
I've made it a warning, however, it could also be reasoned to be an error.
resolved all threads
marked the checklist item First starting the CB, then starting the RI to connect, and finally launching the UI, the
Connected Robotspage shows whether the robot is currently connected (should be true) as incompletemarked the checklist item
ruff formatshows that all files have been left unchanged. as incompletemarked the checklist item
ruff checkshows that 'All checks passed!'. as incompletemarked the checklist item
uv run --only-group test pytest test/unitshow that all test pass as incompletemarked the checklist item
uv run --only-group test pytest test/unitshow that all test pass as completedmarked the checklist item
ruff checkshows that 'All checks passed!'. as completedmarked the checklist item
ruff formatshows that all files have been left unchanged. as completedmarked the checklist item First starting the CB, then starting the RI to connect, and finally launching the UI, the
Connected Robotspage shows whether the robot is currently connected (should be true) as completedmarked the checklist item AFTER, disconnecting the RI (by Cntr+C or other ways) should result in the page showing the robot is disconnected. as completed
marked the checklist item Then, when reconnecting (using same ports) on RI, it should switch back to connected again. as completed
marked the checklist item The agent correctly starts up again after disconnecting on RI and reconnecting. This is also shows correctly in the logs of the CB. as completed
marked the checklist item The code changed by this merge follows the
Code Style Guides. as completedmarked the checklist item The code changed by this merge is well documented. as completed
approved this merge request
approved this merge request
mentioned in commit
df1e891a22