Closed Bug 982158 Opened 10 years ago Closed 10 years ago

Write a unit test that forces a crash and make sure the suite recovers

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect, P2)

Other
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1038868

People

(Reporter: zcampbell, Unassigned)

References

Details

Attachments

(1 file)

Write a gaiatest unit test that forces the device or firefox os to crash. Check that the suite recovers.

It'd be nice but not mandatory if this works on both desktopb2g and device.

https://wiki.mozilla.org/B2G/QA/Tips_And_Tricks#How_to_Force_a_crash
Assignee: nobody → zcampbell
Assignee: zcampbell → nobody
Priority: -- → P2
(In reply to Johan Lorenzo [:jlorenzo] from comment #2)
Scratch that, wrong bug. Sorry.
Tried to implement that kind of test. I left some questions in the PR review. Have you any idea about how can you programmatically check that the suite is still running?

Also, regarding the link given by Zac, I'm wondering: is it possible to give adb instructions to b2gdesktop?
Attachment #8429707 - Flags: feedback?(zcampbell)
Attachment #8429707 - Flags: feedback?(florin.strugariu)
Johan, no it's not. We'd need to crash desktopb2g in some other matter.

I attempted this bug myself when I created it and it's very tricky, maybe not even possible.
My solution was to just stop and start the b2g process directly but I never got it working properly.

There are many different ways it can crash of course but I thought this was the only one we can depend on. Here is the commit:
https://github.com/zacc/gaia/commit/7a546b4d3a5f0fede9de0c818788ecfe8e64b5d7
Can't we force this to crash with a JS call or something ?

I can easy crash the device with something like:

self.marionette.execute_script('''
die ()
function die () {
  setTimeout(function () {die(); die()}, 0)
}''')


and this should work on both device and desktop
Attachment #8429707 - Flags: feedback?(florin.strugariu) → feedback-
(In reply to Florin Strugariu [:Bebe] from comment #6)
I couldn't make an hamachi crash with the fork bomb you proposed. I could only make it freeze. In that case, waiting for the pid to change is ineffective. Do you have any other idea on which stopping point we could use?
Johan, try using the device manager to run:
"adb shell kill -6 /system/b2g/b2g"

Probably won't work on Travis/desktopb2g but we can get to that later.
(In reply to Zac C (:zac) from comment #8)
> Johan, try using the device manager to run:
> "adb shell kill -6 /system/b2g/b2g"
> 
> Probably won't work on Travis/desktopb2g but we can get to that later.

It definitely won't work on desktop B2G as that doesn't use ADB. We should be able to kill the mozrunner process though. Perhaps http://hg.mozilla.org/mozilla-central/file/78245b8d422d/testing/mozbase/mozrunner/mozrunner/base.py#l127 although it probably makes sense to split out into a separate bug.
Depends on: 1001322
I don't think we'll get this done reasonably until bug 1001322 is resolved (in which MarionetteTestCase.setUp() and tearDown() will be modified to handle better cases where the server is not responding.
Then there won't be so many workarounds required in the test framework itself.
Comment on attachment 8429707 [details]
PR https://github.com/mozilla-b2g/gaia/pull/19694

Come back to this after the above blockage in Marionette is resolved.
Attachment #8429707 - Flags: feedback?(zcampbell)
This will be done by Dave when we get the B2GDeviceRunner code in.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: