Closed Bug 559877 Opened 14 years ago Closed 14 years ago

Fix timeout in test_559800.js

Categories

(Toolkit :: Add-ons Manager, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9.3a5

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Whiteboard: [rewrite])

Attachments

(1 file)

      No description provided.
Shawn can you give me some suggestions here.

What is the effect of opening a connection to an database that is in the middle of being closed with asyncClose?
Depends on how you open it (pragmas), but file locks can still exist on the file.
Here is what I appear to be seeing.

I close the database with asyncClose.
Without waiting I delete the database file.
Then I open the database again.

At this point I appear to have the old database as if it was never deleted. Does this match your expectations and is there any way to avoid it without needing to wait for the callback from asyncClose?
(In reply to comment #3)
> At this point I appear to have the old database as if it was never deleted.
> Does this match your expectations and is there any way to avoid it without
> needing to wait for the callback from asyncClose?
Yeah, I can see that happening very easy, and no, I can't think of a way to avoid that offhand.  If you opened it with an exclusive lock (suggested if you don't want other applications to modify it while you have it open) and disable the shared cache (which is only useful if you have more than one connection anyway), the call to open would fail until it closes.  You could come up with some way to poll based on that, but it's not a pretty solution.
Attached patch patch rev 1Splinter Review
Looks like there isn't an easy way to do an exact test here, this instead simulates the problem by setting the DB schema in the prefs which is what we use to determine if the DB has been migrated before.
Attachment #440540 - Flags: review?(robert.bugzilla)
Whiteboard: [rewrite] → [rewrite][fixed-in-addonsmgr][needs-review]
Comment on attachment 440540 [details] [diff] [review]
patch rev 1

Is it possible to have a new test that sets everything up except for the database to test the original scenario where everything is there besides the database? If so, can you file a followup?
Attachment #440540 - Flags: review?(robert.bugzilla) → review+
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-review] → [rewrite][fixed-in-addonsmgr][needs-landing]
http://hg.mozilla.org/mozilla-central/rev/b9d66dffe46c
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Flags: in-litmus-
Resolution: --- → FIXED
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-landing] → [rewrite]
Target Milestone: --- → mozilla1.9.3a5
This test doesn't fail anymore. Marking as verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: