You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Port the real-daemon lease release tests (tester-army/e2e#1900) - #2483
Ports the five real-daemon lease release tests of e2e-inc/e2e#1900 (packages/mobile/tests/unit/lease-daemon.test.ts). They start a real agent-device daemon against a mock WebDriver server and check that releasing a lease stops the daemon within each time budget. This covers the release and daemon-stop path with a real process, not only fakes. Test-only change.
releases a slow 4 s DELETE 200 via RPC under a 30 s budget
Releases_a_slow_4_s_DELETE_200_via_RPC_...
caps the RPC after 12 s ... when DELETE /session hangs
Caps_the_RPC_after_12_s_...
fails release and stops the real daemon when DELETE /session returns HTTP 500
Fails_release_and_stops_the_real_daemon_...
Helpers mirror upstream's withMockWebDriver, withRealMockLease, isPidAlive, waitForDaemonExit. The .NET-only parts: proxy and NO_PROXY variables are forwarded to the daemon so npx can fetch the pinned agent-device; a Linux zombie daemon counts as exited.
Not ported
NaN budget case in lease.test.ts: a TimeSpan has no NaN. Not applicable.
dotnet test tests/E2E.Mobile.Tests --filter LeaseDaemonTests (net10.0): 16 passed with the real agent-device. /code-review findings fixed (daemon leak on failed acquire, loopback NO_PROXY, CTS disposal).
No actionable comments were generated in the recent review.
Walkthrough
The lease daemon test suite adds a mock WebDriver harness and five tests that exercise real-daemon release behavior for delayed, hanging, and failed session DELETE requests.
Changes: Real-daemon lease release
Layer / File(s)
Summary
Real-daemon test harness tests/E2E.Mobile.Tests/LeaseDaemon/LeaseDaemonTests.cs
The test setup forwards proxy and Node certificate variables, adds loopback addresses to NO_PROXY, detects exited and zombie processes, hosts a mock WebDriver server, and creates and cleans up real leases.
Five tests verify daemon exit and release outcomes for delayed DELETE responses, a request with no response, and an HTTP 500 response. The delayed-response cases check behavior under different release budgets and account for platform-specific results.
This change only adds real-daemon lease-release tests and does not alter production behavior. No merge-blocking risk was identified.
Important
Pre-merge checks failed
Please resolve all errors before merging. Addressing warnings is optional.
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Upstream Parity
Pull request inputs changed after this check was assessed; its verdict is no longer current.
Re-run the check against the current pull request inputs.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: porting the real-daemon lease release tests from the upstream e2e-inc/e2e#1900 reference. The raw summary and objectives both describe five added tests in LeaseDae…
Linked Issues check
[#2395] Requests five real-daemon tests from e2e-inc/e2e#1900. The change adds these five tests to tests/E2E.Mobile.Tests/LeaseDaemon/LeaseDaemonTests.cs. The change summary describes each one: (1…
Out of Scope Changes check
The change is test-only and touches LeaseDaemonTests.cs. The additional StopEnvironment changes (forwarding proxy and Node certificate variables, adding loopback to NO_PROXY) and the zombie-aware exit…
Full details: Title check
Explanation
The title names the main change: porting the real-daemon lease release tests from the upstream e2e-inc/e2e#1900 reference. The raw summary and objectives both describe five added tests in LeaseDaemonTests.cs that run a real agent-device daemon against a mock WebDriver server, so the title matches the changeset. It is specific and under 70 characters. It uses the upstream PR reference, which a teammate may not recognize, but the title still identifies the primary change.
Full details: Linked Issues check
Explanation
[#2395] Requests five real-daemon tests from e2e-inc/e2e#1900. The change adds these five tests to tests/E2E.Mobile.Tests/LeaseDaemon/LeaseDaemonTests.cs. The change summary describes each one: (1) a 1.5 s DELETE under a 5 s budget, with an unconfirmed-stop error expected on Windows and successful release elsewhere; (2) a 1.5 s DELETE under a 16 s budget without mid-flight cancellation; (3) a 4 s successful DELETE under a 30 s budget; (4) a hanging DELETE with the RPC capped at 12,000 ms; (5) an HTTP 500 DELETE with the WebDriver failure asserted. Each test verifies daemon exit. The helpers (mock WebDriver, WithRealMockLeaseAsync, process-alive and wait-for-exit checks) support these tests. The PR reports 16 passing tests with the real agent-device on net10.0. The NaN case and the TestMu AI and Revyl docs pages are excluded by the issue itself, so they are not required here. Evidence comes from the PR summary and change summary; I did not read the test file hunks directly.
Full details: Out of Scope Changes check
Explanation
The change is test-only and touches LeaseDaemonTests.cs. The additional StopEnvironment changes (forwarding proxy and Node certificate variables, adding loopback to NO_PROXY) and the zombie-aware exit check support running the real daemon via npx in the test environment. They connect to the linked objective and do not alter production code. The PR description states no production declaration changes. No unrelated change was identified from the summaries. I did not inspect the full diff hunks, so this verdict rests on the change summary.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped tester-army/e2e.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Ports the five real-daemon lease release tests of e2e-inc/e2e#1900 (
packages/mobile/tests/unit/lease-daemon.test.ts). They start a real agent-device daemon against a mock WebDriver server and check that releasing a lease stops the daemon within each time budget. This covers the release and daemon-stop path with a real process, not only fakes. Test-only change.Closes #2395
Upstream parity
Verdict: complete for the tests; two items are not ported (below).
itLeaseDaemon/LeaseDaemonTests.cs)Stops_the_real_daemon_process_within_a_5_s_budget_...Stops_the_real_daemon_process_under_a_16_s_budget_...Releases_a_slow_4_s_DELETE_200_via_RPC_...Caps_the_RPC_after_12_s_...Fails_release_and_stops_the_real_daemon_...Helpers mirror upstream's
withMockWebDriver,withRealMockLease,isPidAlive,waitForDaemonExit. The .NET-only parts: proxy andNO_PROXYvariables are forwarded to the daemon so npx can fetch the pinned agent-device; a Linux zombie daemon counts as exited.Not ported
NaNbudget case inlease.test.ts: aTimeSpanhas no NaN. Not applicable.Verification
dotnet test tests/E2E.Mobile.Tests --filter LeaseDaemonTests(net10.0): 16 passed with the real agent-device./code-reviewfindings fixed (daemon leak on failed acquire, loopback NO_PROXY, CTS disposal).Generated by Claude Code
Summary by CodeRabbit