Skip to content

Port the real-daemon lease release tests (tester-army/e2e#1900) - #2483

Merged
kblok merged 2 commits into
mainfrom
fix/2395-real-daemon-lease-tests
Nov 29, 2026
Merged

kblok merged 2 commits into
mainfrom
fix/2395-real-daemon-lease-tests

Conversation

@kblok

@kblok kblok commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

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).

Upstream it Local test (LeaseDaemon/LeaseDaemonTests.cs)
stops the real daemon process within a 5 s budget when DELETE takes 1.5 s Stops_the_real_daemon_process_within_a_5_s_budget_...
...under a 16 s budget when DELETE takes 1.5 s instead of cancelling mid-flight Stops_the_real_daemon_process_under_a_16_s_budget_...
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

Verification

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).


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end coverage for lease release when the daemon responds slowly, does not respond, or returns an error.
    • Added checks for release outcomes across operating systems and timeout budgets, including confirming that the daemon exits after release.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ce2dbdb and 0ba9f3e.

Files selected for processing: 1

  • tests/E2E.Mobile.Tests/LeaseDaemon/LeaseDaemonTests.cs

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.
Lease release cases
tests/E2E.Mobile.Tests/LeaseDaemon/LeaseDaemonTests.cs
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.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: Minimal · previous review ce2db

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 Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Upstream Parity Inconclusive 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 Passed checks: 4 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed [#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 Passed 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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c314814 and ce2dbdb.

Files selected for processing: 1

  • tests/E2E.Mobile.Tests/LeaseDaemon/LeaseDaemonTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

kblok commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

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.

@kblok
kblok merged commit 460ece0 into main Nov 29, 2026
7 of 8 checks passed
@kblok
kblok deleted the fix/2395-real-daemon-lease-tests branch November 29, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port the real-daemon lease release tests of tester-army/e2e#1900

2 participants