Closed Bug 784888 Opened 13 years ago Closed 1 year ago

Test for bug 674742 to prevent dataloss regression due to folder compact

Categories

(MailNews Core :: Backend, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: hiro, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: [patchlove])

Attachments

(4 obsolete files)

Attached patch The test (obsolete) — Splinter Review
Bug 674742 causes dataloss. It should be tested. This test needs a stub of nsIFile (the patch for bug 784870).
Severity: normal → major
Summary: Test for bug 674742 → Test for bug 674742 to prevent dataloss regression due to folder compact
The test should also check the content of the folder equals after compaction. I will post a new test with the approach that the target file/directory make read-only.
Changing dependency. The test depend on the patch for bug 784870 since the result of nsIMsgFolderCompactor.compact should be checked in the test.
Depends on: 782868
No longer depends on: 784870
This is a try. Unfortunately making the target file read-only does not work well at all. It can work no errors! This patch tries to make the parent directory of the target read-only. It gets NS_ERROR_FILE_ACCESS_DENIED at CreateUnique in nsFolderCompactState::Init(). Sadly the failure result does not return, so this test hangs... I will open a new bug for this hang.
Assignee: nobody → hiikezoe
Attachment #654469 - Attachment is obsolete: true
Status: NEW → ASSIGNED
I am sorry that I posted the patch before qrefresh.
Attachment #654867 - Attachment is obsolete: true
(In reply to Hiroyuki Ikezoe (:hiro) from comment #3) > This patch tries to make the parent directory of the target read-only. It > gets NS_ERROR_FILE_ACCESS_DENIED at CreateUnique in > nsFolderCompactState::Init(). > Sadly the failure result does not return, so this test hangs... > > I will open a new bug for this hang. Filed bug 785274.
Depends on: 785274
Attached patch Another test with nsIFileStub (obsolete) — Splinter Review
Yay! Now the test with nsIFileStub works fine without any patch against mozilla-central.
Mark, now I'd recommend the second test even if it needs the stub for nsIFile. I will maintain the stub code as possible.
Attachment #654944 - Attachment is obsolete: true
Attachment #654868 - Attachment is obsolete: true
I can write a new test code after bug 786936 is closed.
Depends on: 786936
Assignee: hiikezoe → nobody
Status: ASSIGNED → NEW
Whiteboard: [patchlove]
an example of where our compact tests are substandard
Depends on: 784870
See Also: → 274330, 498274

Can we call this and bug 784870 obsolete?

Flags: needinfo?(benc)

Yes, I think so... but they are larger issues: our testing of outside-the-app I/O failures (disk, network, whatever) is pretty awful at the moment.
I think it's worth another more comprehensive attempt, so I just wrote up Bug 1897667.

Flags: needinfo?(benc)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
See Also: → 1897667
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: