Open Bug 2059876 Opened 19 days ago Updated 6 days ago

Remove fudge-factor delays in imap nsIMsgOfflineManager tests

Categories

(MailNews Core :: Networking: IMAP, defect)

Thunderbird 141
defect

Tracking

(Not tracked)

People

(Reporter: benc, Unassigned)

Details

A bunch of the IMAP nsIMsgOfflineManager tests use fudge factor delays to pass.
We should never need such delays.

Some examples:
https://searchfox.org/comm-central/rev/72b8ba0761b3881d926be53f77fbf75d5a9316d5/mailnews/imap/test/unit/test_offlineDraftDataloss.js#98
https://searchfox.org/comm-central/rev/72b8ba0761b3881d926be53f77fbf75d5a9316d5/mailnews/imap/test/unit/test_offlinePlayback.js#107

To Replicate:

Edit test_nsImapOfflineDownloader.js and comment out the fudge factor delay:

// await PromiseTestUtils.promiseDelay(100);

Run it in --verify mode:

$ ./mach xpcshell-test --verify comm/mailnews/imap/test/unit/test_nsImapOfflineDownloader.js

See that the test fails sometimes (due to some messages not being marked offline)

With the delay the test is a solid pass, even with --verify.

What I think is happening:

The test calls offlineManager.synchronizeForOffline() to download the messages. Internally that calls nsIImapService.downloadAllOffineImapFolders().

I think that nsIImapService.downloadAllOffineImapFolders() might sometimes invoke onStopRunningUrl() on the listener before all downloaded messages are marked offline.

Version: unspecified → Thunderbird 141
You need to log in before you can comment on or make changes to this bug.