Last Comment Bug 836061 - Multiple consistent test failures on m-i and m-c test runs.
: Multiple consistent test failures on m-i and m-c test runs.
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
https://tbpl.mozilla.org/php/getParse...
Depends on:
Blocks: 786135 836564
  Show dependency treegraph
 
Reported: 2013-01-29 15:10 PST by Wes Kocher (:KWierso)
Modified: 2013-01-31 13:35 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/748 (355 bytes, text/html)
2013-01-30 10:38 PST, Dave Townsend [:mossop]
poirot.alex: review+
Details

Description Wes Kocher (:KWierso) 2013-01-29 15:10:14 PST
Something in https://tbpl.mozilla.org/?noignore=1&tree=Mozilla-Inbound&jobname=jetpack&rev=67f7ebdea2fe broke several of our tests:

The following tests failed:
  test-addon-installer.test Install: failure
  test-addon-installer.test Update: failure
  test-byte-streams.testReadLengths: exception
  test-byte-streams.testTruncate: exception
  test-byte-streams.testWriteRead: exception
  test-byte-streams.testWriteReadBig: exception
  test-byte-streams.testWriteReadChunks: exception
  test-file.testOpenTypes: exception
  test-page-mod.testEvents: timed out
  test-page-mod.testPageModCssDestroy: failure
  test-simple-storage.testQuotaExceededHandle: failure
  test-simple-storage.testQuotaExceededNoHandle: failure
  test-simple-storage.testSetGet: failure
  test-simple-storage.testSetGetRootArray: failure
  test-simple-storage.testSetGetRootBool: failure
  test-simple-storage.testSetGetRootNull: failure
  test-simple-storage.testSetGetRootNumber: failure
  test-simple-storage.testSetGetRootObject: failure
  test-simple-storage.testSetGetRootString: failure
  test-simple-storage.testSetNoSetRead: failure
  test-text-streams.testWriteAsync: timed out
  test-text-streams.testWriteRead: exception
  test-tmp-file.testCreateFromString: exception
  test-tmp-file.testCreateFromURL: exception

I'm seeing several tracebacks similar to this:
error: addon-sdk: fail: Install failed: -1
info: addon-sdk: Traceback (most recent call last):
  File "resource://gre/modules/XPIProvider.jsm", line 4869, in AI_onStopRequest
    this.downloadFailed(AddonManager.ERROR_NETWORK_FAILURE, aStatus);
  File "resource://gre/modules/XPIProvider.jsm", line 4887, in AI_downloadFailed
    this.wrapper);
  File "resource://gre/modules/AddonManager.jsm", line 2064, in AMP_callInstallListeners
    aArgs);
  File "resource://gre/modules/AddonManager.jsm", line 1156, in AMI_callInstallListeners
    if (listener[aMethod].apply(listener, aArgs) === false)
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/addon/installer.js", line 62, in install/listener.onDownloadFailed
    this.onInstallFailed(aInstall);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/addon/installer.js", line 59, in install/listener.onInstallFailed
    reject(aInstall.error);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/core/promise.js", line 153, in reject
    deferred.resolve(rejection(reason))
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/core/promise.js", line 143, in resolve
    while (pending.length) result.then.apply(result, pending.shift())
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/core/promise.js", line 45, in then
    return { then: function then(resolve, reject) { reject(reason) } }
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/core/promise.js", line 118, in rejected
    function rejected(reason) { deferred.resolve(reject(reason)) }
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/core/promise.js", line 55, in effort
    try { return f(options) }
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/tests/test-addon-installer.js", line 46, in onFailure
    assert.fail("Install failed: "+code);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/test/assert.js", line 68, in fail
    this._log.fail(e);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 88, in fail
    this.console.trace();


And others like this:
error: addon-sdk: An exception occurred.
NS_ERROR_FILE_ACCESS_DENIED: Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIFileInputStream.init]
undefined 162
Traceback (most recent call last):
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/timers.js", line 31, in notify
    callback.apply(null, args);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 286, in null
    timer.setTimeout(function() { onDone(self); }, 0);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 456, in null
    options.onDone(self);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 438, in runNextTest
    self.start({test: test, onDone: runNextTest});
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 469, in start
    this.test.testFunction(this);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/tests/test-byte-streams.js", line 130, in exports.testTruncate
    stream = open(test, fname);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/tests/test-byte-streams.js", line 164, in open
    let stream = file.open(filename, forWriting ? "wb" : "b");
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/io/file.js", line 162, in open
    stream.init(file, OPEN_FLAGS.RDONLY, 0, 0);


And more:
info: addon-sdk: Traceback (most recent call last):
  File "resource://gre/modules/NetUtil.jsm", line 85, in null
    aCallback(aStatusCode);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/io/text-streams.js", line 185, in null
    callback.call(self, err);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/simple-storage.js", line 171, in writeAsync
    this.onWrite(this);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/tests/test-simple-storage.js", line 296, in null
    test.assert(compare(ss.storage, val), "Value should persist");
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 156, in assert
    this.fail(message);
  File "resource://dc749199-2188-468f-9c2e-836b4ec4d0a4-at-jetpack/addon-sdk/lib/sdk/deprecated/unit-test.js", line 88, in fail
    this.console.trace();


Oddly, the Win Opt builds seem unaffected.

I don't see anything in that push that stands out as a likely suspect.
Comment 1 Dave Townsend [:mossop] 2013-01-30 09:54:11 PST
This was caused by bug 786135 turning off the octal behaviour of parseInt which we use to set file and directory permissions in the SDK code.
Comment 2 Dave Townsend [:mossop] 2013-01-30 10:38:09 PST
Created attachment 708217 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/748

Pointer to Github pull-request
Comment 3 Dave Townsend [:mossop] 2013-01-30 10:38:40 PST
Comment on attachment 708217 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/748

This fixes the test failures on my linux VM
Comment 4 Alexandre Poirot [:ochameau] 2013-01-30 11:35:13 PST
Comment on attachment 708217 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/748

Thanks for figuring out that so quickly!
Comment 5 Jeff Walden [:Waldo] (remove +bmo to email) 2013-01-30 11:49:58 PST
Note that really you should add the radix to every call to parseInt, not just the ones where there was a behavior change, as a matter of good style and bug-avoidance both:

http://web.archive.org/web/20120711120755/http://whereswalden.com/2011/02/26/the-proper-way-to-call-parseint-tldr-parseintstr-radix/

Style guides these days pretty much always say to specify a radix, partly because of this octal/decimal issue, partly because if your input string format changes you can get unexpectedly weird results.
Comment 6 [github robot] 2013-01-30 12:06:20 PST
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/e55273263c075229c6f3f7d4fd55eb632f1304a0
Bug 836061: Specify the radix for octal parseInt calls. r=ochemeau
Comment 7 Dave Townsend [:mossop] 2013-01-30 12:07:02 PST
We should cherry-pick this to stabilization and update the m-c test changeset.
Comment 8 Wes Kocher (:KWierso) 2013-01-30 14:06:01 PST
Pushed an update to our tests in m-i to pick up this fix: http://hg.mozilla.org/integration/mozilla-inbound/rev/125b4493eaec
Comment 9 [github robot] 2013-01-30 20:38:15 PST
Commit pushed to release at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/72abaf8258e693b99d784da9e284ebb7e8b3c52c
Bug 836061: Specify the radix for octal parseInt calls. r=ochemeau
Comment 10 [github robot] 2013-01-30 20:40:45 PST
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/72abaf8258e693b99d784da9e284ebb7e8b3c52c
Bug 836061: Specify the radix for octal parseInt calls. r=ochemeau
Comment 11 Ryan VanderMeulen [:RyanVM] 2013-01-31 13:35:41 PST
https://hg.mozilla.org/mozilla-central/rev/125b4493eaec

Note You need to log in before you can comment on or make changes to this bug.