Skip to content

fix: log why device allocation silently waits when no device matches - #313

Merged
gmegidish merged 1 commit into
mainfrom
fix/log-silent-device-allocation
Sep 16, 2026
Merged

gmegidish merged 1 commit into
mainfrom
fix/log-silent-device-allocation

Conversation

@gmegidish

Copy link
Copy Markdown
Member

Summary

When no local device matches the allocation criteria (offline, name/id/type/osVersion mismatch), the mobilecli allocator throws NoDeviceAvailableError and the device pool silently re-queues the waiter. With a single local device nothing ever releases, so the test hangs with the last log line being mw:driver-mobilecli found 1 device(s).

  • mw:driver-mobilecli: on no match, log criteria, taken ids, and each device's id/name/state/type/osVersion
  • mw:device-pool (new namespace): log when a waiter is re-queued

Test plan

  • npm run build
  • device-pool + mobilecli tests pass (78 passed)
  • Reproduce with an offline/mismatched device and DEBUG=mw:*, confirm the mismatch is visible

@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 4819da08-e88c-48c7-9eef-59d2fea4e7f2

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 94a72d9 and a9ef0b6.

πŸ“’ Files selected for processing (2)
  • packages/driver-mobilecli/src/driver.ts
  • packages/mobilewright/src/device-pool/application/device-pool.ts

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


Walkthrough

MobilecliDriver.allocate now logs allocation details when no device matches. DevicePool now logs waiter re-queue events and allocation criteria when allocation fails with NoDeviceAvailableError. Existing device selection, error handling, and re-queue behavior remain unchanged.

Priority: ⬇️ Low

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description check βœ… Passed The description directly explains the added diagnostic logging for device allocation waits and includes the test plan.
Title check βœ… Passed The title clearly and concisely describes the main change: logging why device allocation waits when no device matches.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/log-silent-device-allocation

Comment @coderabbitai help to get the list of available commands.

@gmegidish
gmegidish merged commit 54d4b00 into main Sep 16, 2026
6 of 7 checks passed
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.

1 participant