Retrying failed scenario due to HTTPClient::KeepAliveDisconnected error

305 views
Skip to first unread message

csytsma

unread,
Feb 24, 2015, 12:56:57 PM2/24/15
to calabash...@googlegroups.com
I occasionally get the HTTPClient::KeepAliveDisconnected error in my tests, and appears to be the result of my app crashing, but not exactly sure.  However, the next scenario always starts right up and the tests proceed, usually without further failures.

I'd like to be able to catch these KeepAliveDisconnected errors, and just retry the scenario, without marking it as Failed and skipping it.

I'm assuming I'll want to Rescue, evaluate the Error type, and if a KeepAliveDisconnected, retry the scenario. Otherwise, pass the exception on as normal.  I'm not sure where I'd actually do the Rescue though, and be able to retry the scenario.

If anyone has done something similar, any advice would be appreciated.

Thanks,
Cory

DZ

unread,
Feb 25, 2015, 3:54:29 AM2/25/15
to calabash...@googlegroups.com
hi,
not sure if this is exactly what you want but look at this post:

basically you should add code in app life cycle hooks that checks if scenario failed.
then you can try and check the error itself and in case its HTTPClient::KeepAliveDisconnected error, rerun the test.

Sher Bhachu

unread,
Feb 25, 2015, 12:45:29 PM2/25/15
to calabash...@googlegroups.com
I have noticed that this use to be a problem with the device I was usually testing, I rarely saw this when testing with simulators, usually a reboot of the phone resolved this. It would be useful to know if this is happening for you when testing on real devices or simulators/emulators.
Message has been deleted

csytsma

unread,
Mar 3, 2015, 2:52:28 PM3/3/15
to calabash...@googlegroups.com
DZ, thanks for the info and links, that was helpful.  I'll probably try one of those methods.

Sher, I've been getting these errors on a device. I just went and tested on my VirtualBox emulator, and I don't get them.

(EDIT: deleted my prior post, as it was incorrect, no correlation between new calabash version and app crashing.)

Sher Bhachu

unread,
Mar 9, 2015, 12:20:41 PM3/9/15
to calabash...@googlegroups.com
Yep, interesting, those were my findings too.

Are you able to run adb logcat in the background ? I am wondering if that could give us some direction?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages