Last Comment Bug 553353 - test_offlinePlayback.js intermittently failing
: test_offlinePlayback.js intermittently failing
Status: RESOLVED FIXED
: intermittent-failure
Product: MailNews Core
Classification: Components
Component: Testing Infrastructure (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Thunderbird 3.3a1
Assigned To: Mark Banner (:standard8, limited time in Dec)
:
:
Mentors:
http://mxr.mozilla.org/comm-central/s...
Depends on:
Blocks: 438871
  Show dependency treegraph
 
Reported: 2010-03-18 12:17 PDT by Ben Bucksch (:BenB)
Modified: 2012-11-25 19:31 PST (History)
2 users (show)
standard8: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
.1-fixed
.9-fixed


Attachments
Proposed fix (507 bytes, patch)
2010-05-29 04:32 PDT, Mark Banner (:standard8, limited time in Dec)
mozilla: review+
standard8: approval‑thunderbird3.0.9+
standard8: approval‑thunderbird3.1.1+
Details | Diff | Splinter Review

Description Ben Bucksch (:BenB) 2010-03-18 12:17:50 PDT
Setup:
- Linux
- TB trunk (cc/mc) without any changes 
Reproduction:
make -s -C mailnews/imap/test/ xpcshell-tests

mailnews/imap/test/unit/test_offlinePlayback.js on fails for me, since at least a week. Please fix it.
Comment 1 Mark Banner (:standard8, limited time in Dec) 2010-03-18 12:59:02 PDT
(In reply to comment #0)
> mailnews/imap/test/unit/test_offlinePlayback.js on fails for me, since at least
> a week. Please fix it.

All the check tinderboxes which run that test (and build release/static mailnews) are working fine, although admittedly I've seen one or two intermittent failures.

I'd rather have a log output and some idea of what build setup (debug/release) you're using before we tackle this.
Comment 2 Mark Banner (:standard8, limited time in Dec) 2010-03-22 08:13:29 PDT
This WFM on latest linux trunk and Mac on debug builds. Tinderboxes are covering the release builds.

So without further information (as already requested), this is WFM...
Comment 3 Blake Winton (:bwinton) (:☕️) 2010-05-11 08:10:21 PDT
It also failed on http://tinderbox.mozilla.org/showlog.cgi?log=Thunderbird3.1/1273588494.1273589712.28310.gz so that might be at least some of the information we need.
Comment 4 Mark Banner (:standard8, limited time in Dec) 2010-05-29 03:26:01 PDT
It fails intermittently on tinderboxes, and I can reproduce here.

So far, it appears that in test 3 which is when the test goes back online, the authentication with the server is sometimes failing, this then results in the connection not being made correctly, and test 4 failing as a result.
Comment 5 Ben Bucksch (:BenB) 2010-05-29 03:34:30 PDT
FWIW, it's currently not failing for me (so seems to be intermittent indeed), so I can't add more info. Thanks for keeping it in mind and tracking it.
Comment 6 Mark Banner (:standard8, limited time in Dec) 2010-05-29 03:49:32 PDT
I'm currently testing a fix for it, I think I know what the issue is.
Comment 7 Mark Banner (:standard8, limited time in Dec) 2010-05-29 04:32:38 PDT
Created attachment 448185 [details] [diff] [review]
Proposed fix

On taking a look at this (as mentioned above), I noticed that authentication step wasn't working properly.

It turns out that before that, when we drop the connection (due to going offline) there is a CLOSE command sent, this seems consistent, however there is also normally a LOGOUT command sent. This doesn't get sent in the failure mode, however the socket connection still gets completely dropped in both states.

In the imap fake server, the LOGOUT command resets the state of the server to requiring AUTH, so if this isn't received we get into the failure state because we can't log into the fake server again.

Therefore I think the fix is to reset the imap fake server handler into the AUTH state (by using its resetTest call) when the socket is closed, I think this simulates what would happen in reality. Hence, when we reconnect it'll work correctly.

I did consider just calling resetTest from test_offlinePlayback.js, but I could see this being hit elsewhere.

All the tests seem to run fine with this in, I've also been running the test_offlinePlayback.js repeatedly and I can't get it to randomly fail now.
Comment 8 Ben Bucksch (:BenB) 2010-05-29 04:39:17 PDT
> the socket connection still gets completely dropped in both states.
> In the imap fake server, the LOGOUT command resets the state of the server to
> requiring AUTH, so if this isn't received we get into the failure state because
> we can't log into the fake server again.

resetTest() is the right thing to do in that case, yes.
Please add "including requiring authentication again" to the comment.
Comment 9 David :Bienvenu 2010-05-29 06:59:33 PDT
Comment on attachment 448185 [details] [diff] [review]
Proposed fix

seems reasonable.
Comment 10 Mark Banner (:standard8, limited time in Dec) 2010-06-05 07:55:45 PDT
Checked in: http://hg.mozilla.org/comm-central/rev/0f9c2e2a6f94
Comment 11 Mark Banner (:standard8, limited time in Dec) 2010-06-24 01:23:17 PDT
Checked into 192: http://hg.mozilla.org/releases/comm-1.9.2/rev/1f4ca702dc0b
Comment 12 Mark Banner (:standard8, limited time in Dec) 2010-09-27 09:12:32 PDT
Comment on attachment 448185 [details] [diff] [review]
Proposed fix

Just seen on 3.0.x so should consider there as well.
Comment 13 Mark Banner (:standard8, limited time in Dec) 2010-10-01 01:30:07 PDT
Checked in to 1.9.1: http://hg.mozilla.org/releases/comm-1.9.1/rev/2cbfe1e7e95a

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