Conversation
c7b8c91 to
e5806ee
Compare
e5806ee to
4abbe50
Compare
|
@omnarayan, when you have a moment, could you take a look at this stack? It is five small fixes, each bringing maestro-runner's behaviour in line with Maestro's, with tests and a CHANGELOG line:
They are stacked in that order so that merging one never conflicts with the next, and each description now follows the PR template. We run all five on a physical iPhone in our nightly suite. Happy to split, rebase or change anything that would make them easier to review. |
The WDA driver reads an element's name, rect, text and displayed in parallel, and a tap looks an element up four ways at once. The client used Go's default transport, which keeps two idle connections per host, so every such burst closed two connections and opened two new ones. On a real iPhone reached through a forward (SSH, then iproxy over USB) a new connection costs about 300 ms, and new ones opened together fail at once with EOF. In one 44-flow run, 297 of 996 element bursts lost exactly two reads (the two new connections), 2 lost one, and none lost a read on a kept connection: 976 EOFs, each sent again by the dropped-connection retry. WebDriverAgent does not close an idle keep-alive connection (FBHTTPServer exempts them from its reaper), so a stale reuse was not the cause. The client now keeps up to eight idle connections per host. In the new tests, 50 bursts of four reads open 4 connections instead of 102, and through a server that drops every new connection past the first four, no read fails (the old client lost 23 reads there, after 196 dropped connections).
4abbe50 to
17d9d27
Compare
|
Thank you @bulatgaleev, and thanks for the measurements: 976 EOFs traced to the default transport's two idle connections is exactly the kind of detail that makes this easy to review. The change is small and WDA-only, and it merges cleanly on today's |
Summary
The WDA driver sends up to four requests at once: an element's name, rect, text and displayed are read in parallel, and a tap looks an element up four ways at once. Its HTTP client used Go's default transport, which keeps two idle connections per host, so every burst closed two connections and opened two new ones. On a physical iPhone reached through a forwarded port (SSH, then iproxy over USB), a new connection costs about 300 ms, and new connections opened together fail at once with EOF. The client now keeps up to eight idle connections per host.
Type of Change
Changes Made
http.DefaultTransportwithMaxIdleConnsPerHostset to 8.pkg/driver/wda/kept_connections_test.go: 50 bursts of four reads open 4 connections instead of 102, and through a server that drops every new connection past the first four, no read fails. The old client lost 23 reads there, after 196 dropped connections.Related Issues
No existing issue found.
Testing
go test ./pkg/driver/wda/go vet ./...andmake fmt-checkpass (run on the top of the stack, fix(wda): checked selectors work on iOS #185, which contains all five changes)make testas a whole: not run, because its device tests drive whatever device is attached to the machinemake lint: the Makefile has nolinttarget, and the lintersmake checkruns (staticcheck, revive, errcheck, nilaway, gosec) are not installed hereChecklist
Additional Notes
Stack 1 of 5: #181 → #182 → #183 → #184 → #185. Merge in that order. This is the base of the stack; its change is
17d9d27. All five sit onmainatfe3dd53(the 1.1.28 release).