Closed Bug 922465 Opened 11 years ago Closed 11 years ago

Automated tests for the Nuwa process

Categories

(Core :: IPC, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29
blocking-b2g 1.3+
Tracking Status
firefox27 --- wontfix
firefox28 --- fixed
firefox29 --- fixed
b2g-v1.3 --- fixed

People

(Reporter: cyu, Assigned: kk1fff)

References

Details

Attachments

(1 file, 4 obsolete files)

The Nuwa templated content process is now disabled by default. We need to add automated tests for turning it on.
Attached patch WIP: Observe Nuwa process creation. (obsolete) (deleted) — Splinter Review
Test to observe NuwaReady. This basically works if we startup emulator only for this test case, since the preallocated process is not there then, we can observe it's event. But if the emulator has already run many tests before running this, we will need to restart the preallocated process. The preference observer doesn't seem work, I am still finding a way to restart it.
Attachment #819300 - Flags: feedback?(cyu)
Depends on: 928995
Comment on attachment 819300 [details] [diff] [review] WIP: Observe Nuwa process creation. Review of attachment 819300 [details] [diff] [review]: ----------------------------------------------------------------- This test looks good, but we need to consider for the failure path and don't block the whole test suite if RecvNuwaReady() is never called. If for some reason the Nuwa process won't be ready, we need to timeout and fail the test explicitly. The timeout value can be a loose, but not too big, value. 1 min is a safe value, I guess.
Attachment #819300 - Flags: feedback?(cyu)
Assignee: nobody → pwang
Attached patch WIP: Observe Nuwa process creation. (obsolete) (deleted) — Splinter Review
Attachment #819300 - Attachment is obsolete: true
Blocks: 930282
Current status of test case: since running program in emulator is slower than in a real device, we are likely to be affected by bug 941466. It would result in all test cases time out once Nuwa is turned on. Cervantes suggests we turn off PreloadSlowThings in emulator prevent asynchrous events from being dispatched after start to freeze. I tested turing off PreloadSlowThings on try server, the tests cases are all passed. I think we can turn off PreloadSlowThings on emulator for now, and re-enable it after we fixed bug 941466.
Depends on: 941466
I don't really like the idea of turning off PreloadSlowThings in the emulator because it means that we're no longer testing the same code that we're shipping. We have every reason to believe that users will hit this.
Attached patch Test nuwa creation and fork new process. (obsolete) (deleted) — Splinter Review
Attachment #823988 - Attachment is obsolete: true
Comment on attachment 8340314 [details] [diff] [review] Test nuwa creation and fork new process. Review of attachment 8340314 [details] [diff] [review]: ----------------------------------------------------------------- Kyle, could you help review this patch?
Attachment #8340314 - Flags: review?(khuey)
blocking-b2g: --- → 1.3?
Comment on attachment 8340314 [details] [diff] [review] Test nuwa creation and fork new process. Review of attachment 8340314 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/ipc/PreallocatedProcessManager.cpp @@ +285,5 @@ > + nsCOMPtr<nsIMessageBroadcaster> ppmm = > + do_GetService("@mozilla.org/parentprocessmessagemanager;1"); > + nsresult rv = ppmm->BroadcastAsyncMessage( > + NS_LITERAL_STRING("TEST-ONLY:nuwa-add-new-process"), > + JSVAL_NULL, JSVAL_NULL, AutoJSContext(), 1); AutoJSContext cannot be used as a temporary. If you ran this in a debug build it would assert at http://mxr.mozilla.org/mozilla-central/source/mfbt/GuardObjects.h#97 @@ +324,5 @@ > + nsCOMPtr<nsIMessageBroadcaster> ppmm = > + do_GetService("@mozilla.org/parentprocessmessagemanager;1"); > + nsresult rv = ppmm->BroadcastAsyncMessage( > + NS_LITERAL_STRING("TEST-ONLY:nuwa-ready"), > + JSVAL_NULL, JSVAL_NULL, AutoJSContext(), 1); Same here.
Attachment #8340314 - Flags: review?(khuey) → review-
Attached patch Patch: Test nuwa creation and fork new process. (obsolete) (deleted) — Splinter Review
I just realized AutoJSContext cannot be used as a temporary object. Thank for catching this, Kyle.
Attachment #8340314 - Attachment is obsolete: true
Attachment #8343593 - Flags: review?(khuey)
Remove redundant log message from test_NuwaProcessCreation.html
Attachment #8343593 - Attachment is obsolete: true
Attachment #8343593 - Flags: review?(khuey)
Attachment #8343606 - Flags: review?(khuey)
Comment on attachment 8343606 [details] [diff] [review] Patch: Test nuwa creation and fork new process. Review of attachment 8343606 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/ipc/tests/test_NuwaProcessCreation.html @@ +75,5 @@ > + }; > + let timeout = setTimeout(function() { > + ok(false, "Nuwa process is not launched"); > + testEnd(); > + }, 60000); Do we really need to wait a full minute here?
Attachment #8343606 - Flags: review?(khuey) → review+
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #11) > Do we really need to wait a full minute here? It won't take that long if test pass. If we get the two message, we can finish the test. Setting 1 minute is because emulator is slower then real device.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Backed out in https://hg.mozilla.org/mozilla-central/rev/06b3a7aea2c0 for frequent (somewhere between 20 and 50%) xpcshell shutdown crashes like https://tbpl.mozilla.org/php/getParsedLog.php?id=31651189&tree=B2g-Inbound
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla28 → ---
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
for rel eng
blocking-b2g: 1.3? → 1.3+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: