feat(web): PR 4 - E2E#3045
Conversation
Greptile SummaryThis PR adds end-to-end support for the Deno relay. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "feat(web): relay process management, e2e..." | Re-trigger Greptile |
| parser.add_argument("--secs", type=float, default=0, help="run time; 0 = until Ctrl-C") | ||
| args = parser.parse_args() | ||
|
|
||
| if args.url is not None: |
There was a problem hiding this comment.
Viewer URL Misroutes Robot Connection
When --url receives the wtUrl exposed by /api/info, it ends in /viewer. RelayClient.connect(url, "robot") preserves that path, so the relay registers the supposed robot as a viewer and drops its data frames. The demo then reports no delivered odometry despite both connections succeeding.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| process = RelayProcess() | ||
| info = process.start() | ||
| robot = await RelayClient.connect(info.wt_url, "robot") | ||
| try: | ||
| await robot.hello() | ||
| writer = robot.latest_writer("cam") | ||
| writer.offer(b"x" * 1000) | ||
| await asyncio.sleep(0.1) # let the pump start | ||
| process.stop() # graceful shutdown sends CONNECTION_CLOSE | ||
|
|
||
| await asyncio.wait_for(robot.wait_closed(), timeout=10.0) | ||
| assert robot.is_closed | ||
| await asyncio.sleep(0.1) # let the pump observe the close | ||
| assert writer._task.done() | ||
| # A dead channel is visible at the producer. | ||
| with pytest.raises(RuntimeError): | ||
| writer.offer(b"y") | ||
| finally: | ||
| await robot.close() | ||
| process.stop() |
There was a problem hiding this comment.
Failed Connect Skips Relay Teardown
If this connection raises after process.start() succeeds, robot is never assigned. The finally block then raises while evaluating await robot.close() and never reaches process.stop(), leaving the Deno relay process alive and able to interfere with later tests.
| process = RelayProcess() | |
| info = process.start() | |
| robot = await RelayClient.connect(info.wt_url, "robot") | |
| try: | |
| await robot.hello() | |
| writer = robot.latest_writer("cam") | |
| writer.offer(b"x" * 1000) | |
| await asyncio.sleep(0.1) # let the pump start | |
| process.stop() # graceful shutdown sends CONNECTION_CLOSE | |
| await asyncio.wait_for(robot.wait_closed(), timeout=10.0) | |
| assert robot.is_closed | |
| await asyncio.sleep(0.1) # let the pump observe the close | |
| assert writer._task.done() | |
| # A dead channel is visible at the producer. | |
| with pytest.raises(RuntimeError): | |
| writer.offer(b"y") | |
| finally: | |
| await robot.close() | |
| process.stop() | |
| process = RelayProcess() | |
| robot: RelayClient | None = None | |
| try: | |
| info = process.start() | |
| robot = await RelayClient.connect(info.wt_url, "robot") | |
| await robot.hello() | |
| writer = robot.latest_writer("cam") | |
| writer.offer(b"x" * 1000) | |
| await asyncio.sleep(0.1) # let the pump start | |
| process.stop() # graceful shutdown sends CONNECTION_CLOSE | |
| await asyncio.wait_for(robot.wait_closed(), timeout=10.0) | |
| assert robot.is_closed | |
| await asyncio.sleep(0.1) # let the pump observe the close | |
| assert writer._task.done() | |
| # A dead channel is visible at the producer. | |
| with pytest.raises(RuntimeError): | |
| writer.offer(b"y") | |
| finally: | |
| try: | |
| if robot is not None: | |
| await robot.close() | |
| finally: | |
| process.stop() |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## paul/feat/web-3-python-client #3045 +/- ##
=================================================================
+ Coverage 72.36% 72.53% +0.17%
=================================================================
Files 1030 1033 +3
Lines 92720 93056 +336
Branches 8491 8522 +31
=================================================================
+ Hits 67098 67501 +403
+ Misses 23344 23251 -93
- Partials 2278 2304 +26
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Split 4/4 of the web project setup: RelayProcess child management, demo_smoke, Python<->relay e2e test, and _relay_dist wheel bundling (setup.py + MANIFEST.in). Stacked on paul/feat/web-3-python-client.
fe724ae to
a7cf9ae
Compare
188bc50 to
aef5a79
Compare
No description provided.