Closed
Bug 1213785
Opened 10 years ago
Closed 10 years ago
Intermittent script timed out in test_icc_contact_add.js and test_icc_contact_update.js
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(firefox45 fixed, b2g-v2.5 fixed)
RESOLVED
FIXED
FxOS-S11 (13Nov)
People
(Reporter: edgar, Assigned: jdai)
References
Details
Attachments
(1 file, 2 obsolete files)
Recent try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8ccd09f7dfa4&exclusion_profile=false&group_state=expanded
I believe it is because we added some new test data in bug 1122376 (accessing icc contact is really slow), we could try to rewrite the test a bit to make it faster or increase the timeout value.
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jdai
| Reporter | ||
Comment 1•10 years ago
|
||
Thanks for taking this, John.
| Assignee | ||
Comment 2•10 years ago
|
||
In this patch, I moved out read contact method which is most time-consuming part to make tests faster.
Hi Edgar, May I have your review of this patch? Thanks.
Attachment #8679282 -
Flags: review?(echen)
| Reporter | ||
Comment 3•10 years ago
|
||
Comment on attachment 8679282 [details] [diff] [review]
Fixed test_icc_contact_add.js and test_icc_contact_update.js testcases timeout.
Review of attachment 8679282 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/icc/tests/marionette/test_icc_contact_add.js
@@ +43,5 @@
> is(aResult.tel[0].value, aMozContact.tel[0].value.substring(0, 40));
> // We only support SIM in emulator, so we don't have anr and email field.
> ok(aResult.tel.length == 1);
> ok(!aResult.email);
>
Nit: remove extra space
@@ +58,5 @@
> +function removeContacts(aIcc, aContacts, aType, aPin2) {
> + log("removeContacts: type=" + aType + ", pin2=" + aPin2);
> + let promise = Promise.resolve();
> + let contact;
> + let start = aContacts.length - TEST_ADD_DATA.length;
Is it possible that the caller passes the contacts that we actually want to remove, instead of doing this filtering.
@@ +87,5 @@
> + let start = aResult.length - TEST_ADD_DATA.length;
> +
> + for (let i = start; i < aResult.length ; i++) {
> + let contact = aResult[i];
> + let aMozContact = TEST_ADD_DATA[i - start];
Just drop the unreferenced contacts from |aResult| then we don't have shift the index.
e.g.
aResult = aResult.split(aResult.length - TEST_ADD_DATA.length);
for (let i = 0; i < TEST_ADD_DATA.length; i++) {
....
}
@@ +111,5 @@
> + promise = promise.then(() => testAddContacts(icc, "adn"))
> + // Test add fdn contacts
> + .then(() => testAddContacts(icc, "fdn", "0000"))
> + // Test add fdn contacts without passing pin2
> + .then(() => testAddContacts(icc, "fdn"));
For test without passing pin2, I think we don't need to do with all test data, just one is enough, since they are all the same case actually.
@@ +117,1 @@
> return promise;
return Promise.resolve()
.then(....)
....
.then(....);
::: dom/icc/tests/marionette/test_icc_contact_update.js
@@ +95,5 @@
> + // Get ICC contact for checking expect contacts
> + promise = promise.then(() => aIcc.readContacts(aType))
> + .then((aResult) => {
> + for (let i = 0; i < TEST_UPDATE_DATA.length ; i++) {
> + let aMozContact = TEST_UPDATE_DATA[i];
No `a` prefix for local variables.
@@ +129,5 @@
> })
> + // Test update adn contacts
> + .then(() => testUpdateContacts(icc, "adn", adnContacts))
> + // Test update fdn contacts
> + .then(() => testUpdateContacts(icc, "fdn", fdnContacts))
Ditto: For test without passing pin2, I think we don't need to do with all test data, just one is enough, since they are all the same case actually.
@@ +130,5 @@
> + // Test update adn contacts
> + .then(() => testUpdateContacts(icc, "adn", adnContacts))
> + // Test update fdn contacts
> + .then(() => testUpdateContacts(icc, "fdn", fdnContacts))
> + // Test update fdn contacts without passing pin2
I guess the comment was put in wrong place.
Attachment #8679282 -
Flags: review?(echen)
| Assignee | ||
Comment 4•10 years ago
|
||
Addressed comment 3.
Hi Edgar, May I have your review of this patch? Thanks.
Attachment #8679282 -
Attachment is obsolete: true
Attachment #8681045 -
Flags: review?(echen)
| Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8681045 [details] [diff] [review]
Fixed test_icc_contact_add.js and test_icc_contact_update.js testcases timeout. v2
Review of attachment 8681045 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with comment addressed. Thank you.
::: dom/icc/tests/marionette/test_icc_contact_add.js
@@ +75,5 @@
> +
> + promise = promise.then(() => testAddContact(aIcc, aType, test_data, aPin2));
> + }
> +
> + if (aType === "adn" || (aType === "fdn" && aPin2)) {
Since no pin2 case won't call testAddContacts(), we don't need this check.
@@ +83,5 @@
> + aResult = aResult.slice(aResult.length - TEST_ADD_DATA.length);
> +
> + for (let i = 0; i < aResult.length ; i++) {
> + let contact = aResult[i];
> + let mozContact = TEST_ADD_DATA[i];
s/mozContact/expectedResult/
::: dom/icc/tests/marionette/test_icc_contact_update.js
@@ +94,2 @@
>
> + if (aType === "adn" || (aType === "fdn" && aPin2)) {
Ditto, Since no pin2 case won't be here, we don't need this check.
@@ +96,5 @@
> + // Get ICC contact for checking expect contacts
> + promise = promise.then(() => aIcc.readContacts(aType))
> + .then((aResult) => {
> + for (let i = 0; i < TEST_UPDATE_DATA.length; i++) {
> + let mozContact = TEST_UPDATE_DATA[i];
s/mozContact/expectedResult/
Attachment #8681045 -
Flags: review?(echen) → review+
| Assignee | ||
Comment 6•10 years ago
|
||
Addressed comment 5 and carry on r+.
Try link:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=46f49d327b01&exclusion_profile=false
Attachment #8681045 -
Attachment is obsolete: true
Attachment #8681216 -
Flags: review+
| Assignee | ||
Comment 7•10 years ago
|
||
Try link:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cc5ad1bc3671&exclusion_profile=false
Keywords: checkin-needed
Keywords: checkin-needed
Comment 9•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S11 (13Nov)
Comment 10•10 years ago
|
||
| bugherder uplift | ||
status-b2g-v2.5:
--- → fixed
Comment 11•10 years ago
|
||
| bugherder uplift | ||
You need to log in
before you can comment on or make changes to this bug.
Description
•