iDeviceImageMounter trying to mount devimage after every run in browser_ios.js

I’m running into an issue where I’m trying to perform multiple runs using the WPT agent hooked up to an iPhone, but the agent is trying to mount the DeveloperDiskImage.dmg file every time it performs a run, which is causing issues.

The first run is fine:

D Sep_01_14:28:00.169 process_utils.js:327 ChildProcess. : stdout[129] Uploading /Users/users/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg
done.
Mounting…
Done.
Status: Complete

And I get results! :smiley: But after that, each subsequent run gets the following:

D Sep_01_14:28:46.484 process_utils.js:263 unknown : Exec with timeout(30000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u deviceID /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg.signature
E Sep_01_14:28:47.495 wd_server.js:204 WebDriverServer. : Exception from “Run test”: Error: ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u deviceID /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg.signature failed, code 255, stdout[130] Uploading /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg
done.
Mounting…
Error: ImageMountFailed

The only way to get around this I’ve found is to reboot the iPhone. Is there something I need to change, or is there an issue with each run trying to mount the image, even though it’s mounted?

I’m “very” actively working on fixing the iOS agent right now. If you do a fresh pull it should be better but there are still quite a few rough edges.

Multiple runs should work though repeat view doesn’t work correctly yet (and cookies are probably not cleared correctly). I’m working on video capture right now and should have that sorted out in the next day or two.

Hopefully by the end of the week it will be mostly working though I expect there will still be some reliability issues (every now and then I see safari not respond to dev tools messages).

Here’s the latest run I did on my dev system with video: http://www.webpagetest.org/result/150901_2Z_04ac350b3243ccd13c586884e0df4e75/

The beginning of the video needs to be trimmed out which is what I’m working on right now but I’m pretty excited to have 60fps video capture on iOS and an agent that works with iOS 8.4 (and hopefully 9).

I noticed the very active work:-D. Looks awesome.

Things should be in a much better state now (fully functional as far as I know): http://www.webpagetest.org/result/150902_05_d860ca50371689988110fed8805c5510/

I’ll still be working out some performance issues and maybe some cleanup items (the running apps list on iOS gets littered with pages still). If you run iOS 8.x and Yosemite you can also get video capture (recommend using --processvideo yes to do the video processing on the agent).

I have a couple of iPhone 5c’s coming in tomorrow and the plan is to open up testing to the public and work through the issues as they come up. I’m expecting reliability to be a problem and may have to put in some retry logic if Safari doesn’t start up cleanly.

Next up:

  • see if I can automatically turn the rotation lock on and off and get portrait/landscape testing from the same device
  • make sure multiple devices can run without causing issues (video capture was a pain because it interrupted existing connections to a device so I need to make sure it is isolated to just the device that capture is being initiated on)
  • test with iPads and make sure everything looks ok
  • add tcpdump
  • add support for configuring the hosts file

Cool.

I just did a new pull of the wpt code, but still ran into the mounting problem. Once the dmg is mounted, I disabled the check (scheduleMountDeveloperImageIfNeeded) and then it works fine for me :slight_smile:

I’m really looking forward to all those new features.

hmm, can you run it with “-m debug” and attach the output? It should run imagedevicemounter -l and skip mounting if “ImagePresent: true” comes back indicating that an image is already mounted.

Are you running on an OSX host? I haven’t tried any of it on Linux because video capture won’t work there.

I’m running on a OSX host (I’ve tried to get it running on Ubuntu, and managed to get the agent running, but it can’t mount the developer image at all).

I’ve run with the -m debug output and get the following for the first check:

D Sep_02_14:34:38.108 process_utils.js:263 unknown : Exec with timeout(10000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u device_id -l
D Sep_02_14:34:38.246 process_utils.js:327 ChildProcess. : stdout[37] ImagePresent: false
Status: Complete
D Sep_02_14:34:38.249 process_utils.js:263 unknown : Exec with timeout(10000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceinfo’ -k ProductVersion -u device_id
D Sep_02_14:34:38.321 process_utils.js:327 ChildProcess. : stdout[6] 7.1.2
I Sep_02_14:34:38.323 browser_ios.js:151 BrowserIos. : Mounting device_id /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1
D Sep_02_14:34:38.332 process_utils.js:263 unknown : Exec with timeout(30000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u device_id /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg.signature
D Sep_02_14:34:39.770 process_utils.js:327 ChildProcess. : stdout[129] Uploading /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg
done.
Mounting…
Done.
Status: Complete

But each subsequent run gives me the following:

D Sep_02_14:44:55.010 process_utils.js:263 unknown : Exec with timeout(10000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u device_id -l
D Sep_02_14:44:55.163 process_utils.js:327 ChildProcess. : stdout[37] ImagePresent: false
Status: Complete
D Sep_02_14:44:55.166 process_utils.js:263 unknown : Exec with timeout(10000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceinfo’ -k ProductVersion -u device_id
D Sep_02_14:44:55.240 process_utils.js:327 ChildProcess. : stdout[6] 7.1.2
I Sep_02_14:44:55.242 browser_ios.js:151 BrowserIos. : Mounting device_id /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1
D Sep_02_14:44:55.248 process_utils.js:263 unknown : Exec with timeout(30000): ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u device_id /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg.signature
E Sep_02_14:44:56.058 wd_server.js:204 WebDriverServer. : Exception from “Run test”: Error: ‘/Users/user/wpt/agent/js/lib/ios/idevice/Darwin x86_64/ideviceimagemounter’ -u device_id /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg.signature failed, code 255, stdout[130] Uploading /Users/user/wpt/agent/js/lib/ios/DeviceSupport/7.1/DeveloperDiskImage.dmg
done.
Mounting…
Error: ImageMountFailed

If I run the command standalone, I get the following response:

$ /Users/user/wpt/agent/js/lib/ios/idevice/Darwin\ x86_64/ideviceimagemounter -l
ImagePresent: false
Status: Complete

But if I ssh into the iPhone, I can see that the image is mounted successfully:

root# mount
/dev/disk0s1s1 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk0s1s2 on /private/var (hfs, local, journaled, noatime, protect)
/dev/disk1 on /Developer (hfs, local, read-only)

I’ll change the check to just run the mount command over ssh and check for it that way instead. Should have it fixed shortly. Thanks for the logs.

ok, switched to just checking to see if the mount already exists. Thanks again.

Let me know if you see anything else strange.