Test failure: mailnews/news/test/unit/test_bug540288.js | [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheSession.openCacheEntry]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"

RESOLVED FIXED in Thunderbird 18.0

Status

MailNews Core
Networking: NNTP
--
blocker
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: florian, Assigned: florian)

Tracking

unspecified
Thunderbird 18.0
x86
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

5 years ago
Created attachment 662977 [details] [diff] [review]
Fix

Since bug 695399 landed on mozilla-central, comm-central xpcshell tests are busted:
TEST-UNEXPECTED-FAIL | /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/news/test/unit/test_bug540288.js | test failed (with xpcshell return code: 0), see following log:
TEST-UNEXPECTED-FAIL | /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/news/test/unit/test_bug540288.js | [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsICacheSession.openCacheEntry]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/news/test/unit/test_bug540288.js :: run_test :: line 76" data: no]

The attached patch fixes this test by using asyncOpenCacheEntry instead of openCacheEntry.
(Assignee)

Comment 1

5 years ago
Created attachment 662978 [details] [diff] [review]
diff -w

Same patch without the whitespace changes (diff -w) for easier reviewing.
(Assignee)

Updated

5 years ago
Attachment #662977 - Flags: review?(mconley)
Comment on attachment 662977 [details] [diff] [review]
Fix

Review of attachment 662977 [details] [diff] [review]:
-----------------------------------------------------------------

Just two things. Other than that, this looks good to me.

::: mailnews/news/test/unit/test_bug540288.js
@@ +68,5 @@
>    server.start(NNTP_PORT);
>  
>    try {
>      // Add an empty message to the cache
> +    Cc["@mozilla.org/messenger/nntpservice;1"]

I guess there's no access to MailServices from here? I generally prefer to use that, with MailServices.nntp, as opposed to querying XPCOM for the service.

@@ +71,5 @@
>      // Add an empty message to the cache
> +    Cc["@mozilla.org/messenger/nntpservice;1"]
> +      .getService(Ci.nsINntpService).cacheSession
> +      .asyncOpenCacheEntry(kCacheKey, Ci.nsICache.ACCESS_WRITE, {
> +      onCacheEntryAvailable: function(cacheEntry, access, status) {

I think this block needs to be indented 2 spaces more, to differentiate it from the code above.
Attachment #662977 - Flags: review?(mconley) → review+
(Assignee)

Comment 3

5 years ago
Created attachment 663013 [details] [diff] [review]
Patch with review comments addressed [for check-in]
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/comm-central/rev/712bbc279ec6
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 18.0
You need to log in before you can comment on or make changes to this bug.