Closed Bug 598145 Opened 14 years ago Closed 14 years ago

intermittent errors in simple-storage tests

Categories

(Add-on SDK Graveyard :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: myk, Unassigned)

Details

On Linux against Firefox 3.6, I see a number of intermittent errors in simple-storage tests:

1. error: TEST FAILED: test-simple-storage.testQuotaUsage (timed out)

2. error: TEST FAILED: test-simple-storage.testQuotaExceededNoHandle (timed out)

3. error: fail: Store file should exist
info: Traceback (most recent call last):
  File "file:///home/myk/Applications/firefox-3.6/modules/NetUtil.jsm", line 118, in anonymous
    aCallback(aStatusCode);
  File "resource://testpkgs-jetpack-core-lib/text-streams.js", line 212, in anonymous
    callback.call(self, err);
  File "resource://testpkgs-jetpack-core-lib/simple-storage.js", line 220, in writeAsync
    self._notifyObserversArray(obsArray);
  File "resource://testpkgs-jetpack-core-lib/simple-storage.js", line 192, in JsonStore__notifyObserversArray
    obsArray.shift().call(this.observersThisArg);
  File "resource://testpkgs-jetpack-core-lib/errors.js", line 49, in anonymous
    return callback.apply(this, arguments);
  File "resource://testpkgs-jetpack-core-tests/test-simple-storage.js", line 290, in anonymous
    test.assert(file.exists(storeFilename), "Store file should exist");
  File "resource://testpkgs-jetpack-core-lib/unit-test.js", line 196, in assert
    this.fail(message);
  File "resource://testpkgs-jetpack-core-lib/unit-test.js", line 145, in fail
    console.trace();

4. error: fail: Value should persist
info: Traceback (most recent call last):
  File "file:///home/myk/Applications/firefox-3.6/modules/NetUtil.jsm", line 118, in anonymous
    aCallback(aStatusCode);
  File "resource://testpkgs-jetpack-core-lib/text-streams.js", line 212, in anonymous
    callback.call(self, err);
  File "resource://testpkgs-jetpack-core-lib/simple-storage.js", line 220, in writeAsync
    self._notifyObserversArray(obsArray);
  File "resource://testpkgs-jetpack-core-lib/simple-storage.js", line 192, in JsonStore__notifyObserversArray
    obsArray.shift().call(this.observersThisArg);
  File "resource://testpkgs-jetpack-core-lib/errors.js", line 49, in anonymous
    return callback.apply(this, arguments);
  File "resource://testpkgs-jetpack-core-tests/test-simple-storage.js", line 299, in anonymous
    test.assert(compare(ss.storage, val), "Value should persist");
  File "resource://testpkgs-jetpack-core-lib/unit-test.js", line 196, in assert
    this.fail(message);
  File "resource://testpkgs-jetpack-core-lib/unit-test.js", line 145, in fail
    console.trace();

5. error: An exception occurred.
Traceback (most recent call last):
  File "file:///home/myk/Applications/firefox-3.6/modules/NetUtil.jsm", line 118, in 
    aCallback(aStatusCode);
  File "resource://testpkgs-jetpack-core-lib/text-streams.js", line 212, in 
    callback.call(self, err);
  File "resource://testpkgs-jetpack-core-lib/simple-storage.js", line 220, in writeAsync
    self._notifyObserversArray(obsArray);
  File "resource://testpkgs-jetpack-core-lib/simple-storage.js", line 192, in JsonStore__notifyObserversArray
    obsArray.shift().call(this.observersThisArg);
  File "resource://testpkgs-jetpack-core-lib/errors.js", line 49, in 
    return callback.apply(this, arguments);
  File "resource://testpkgs-jetpack-core-tests/test-simple-storage.js", line 296, in 
    file.remove(storeFilename);
  File "resource://testpkgs-jetpack-core-lib/file.js", line 177, in remove
    ensureFile(file);
  File "resource://testpkgs-jetpack-core-lib/file.js", line 77, in ensureFile
    ensureExists(file);
  File "resource://testpkgs-jetpack-core-lib/file.js", line 85, in ensureExists
    filename: file.path
  File "resource://testpkgs-jetpack-core-lib/xpcom.js", line 185, in friendlyError
    return new Error("path does not exist: " + filename);
  File "", line 0, in Error
Error: path does not exist: /tmp/tmpxYeiCN.mozrunner/jetpack/6724fc1b-3ec4-40e2-8583-8061088b3185/simple-storage/store.json
It's not clear if these are triggered by a single or multiple problems.

Drew: might you have a bit of time to take a look at these?
Weren't there some JID-related changes recently?  Did they affect the environment tests are run in?  If so, they might be the cause, since stores are keyed on JIDs, and "Store file should exist" errors are consistent with JID problems.

I'll try to take a closer look, but if whoever landed the JID changes, if they did in fact land, could go back and run this test before and after, that would be great.
Atul and Brian worked on those JID changes; cc:ing them.
Those changes were pretty small: if an add-on has a JID in the form
"anonid0-NAME" (which only happens in the examples that we provide, plus
packages/development-mode/package.json), then the 'cfx run' and 'cfx xpi'
commands stop complaining about a missing JID.

The only way I can see those changes affecting the tests is if they use
packages/development-mode as their top-level package, in particular if a test
were to store some simple-storage data from an add-on that used that package,
and then tried to retrieve it from an add-on that used a different package.
Doesn't seem too likely to me.

FWIW, I couldn't reproduce the test failure on OS-X against 3.6, so I wasn't
able to compare it with/without the JID changes (which Atul landed 14-Sep for
bug 593651). I get lots of other test failures, but none when doing "cfx test
-a firefox -F test-simple-storage -v" while inside packages/jetpack-core .
Thanks Brian.

Myk, you said these errors are intermittent.  How often can you reproduce them?

Hmm, in errors #1 and 2, the callbacks aren't called after the store is written, or the callbacks for some reason are deferred until after the timeout period allotted to the tests has expired, or the store is not written at all.

In the other three errors, the callback is getting called after the store is written, but then when the callback checks the store file, it doesn't exist.
Urk, sorry Drew, somehow I dropped your question to me on the floor.

I haven't been able to reproduce at all lately.  WORKSFORME?
(In reply to comment #5)
> I haven't been able to reproduce at all lately.  WORKSFORME?

Marking as such, but please reopen if you still see the problem.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
You need to log in before you can comment on or make changes to this bug.