Closed
Bug 424402
Opened 16 years ago
Closed 16 years ago
Test a combination of shared and unshared database connections
Categories
(Toolkit :: Storage, defect, P2)
Toolkit
Storage
Tracking
()
RESOLVED
FIXED
mozilla1.9
People
(Reporter: sdwilsh, Assigned: ondrej)
Details
Attachments
(2 files, 3 obsolete files)
7.39 KB,
patch
|
shaver
:
review+
shaver
:
approval1.9+
|
Details | Diff | Splinter Review |
7.63 KB,
patch
|
Details | Diff | Splinter Review |
We currently don't have any tests in the tree that ensure that using a combination of shared and unshared database connections works as expected. We *really* need this, as this issue was brought up in bug 423273. Myk - I don't have any time for this, would you be willing to pick it up?
Flags: blocking1.9?
Updated•16 years ago
|
Assignee: nobody → ondrej
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Comment 1•16 years ago
|
||
--> final milestone; I'm assuming since Schrep blocked at P2 this wasn't meant to block beta. If it was, set TM to beta5 and P1
Target Milestone: mozilla1.9beta5 → mozilla1.9
Comment 2•16 years ago
|
||
Yes - set P2 for exactly that reason!
Assignee | ||
Comment 3•16 years ago
|
||
So what is expected when we combine shared cache and private cache databases? My understanding is, that from outside, we should not be able to see any difference. This simple test opens two shared cache and two private cache connections to the same database and does some operations which do not lead to NS_ERROR_FILE_IS_LOCKED. But it does not prove anything, I'm afraid.
Reporter | ||
Comment 4•16 years ago
|
||
The trick really is virtual tables work on a shared connection, and do not on an unshared one, so we should make sure that is the case, and somehow test that our turning the shared cache on and off is tested to ensure that it behaves correctly.
Assignee | ||
Comment 5•16 years ago
|
||
Attachment #311763 -
Flags: review?
Assignee | ||
Comment 6•16 years ago
|
||
Comment on attachment 311763 [details] [diff] [review] Test switching opening in shared / unshared mode I was too fast previously. The test opens 4 databases, in different sharing modes: shared, private, shared, private. It tries creating virtual tables on them and expect failure on shared ones. It tests creation of normal table too.
Attachment #311763 -
Flags: review? → review?(sdwilsh)
Assignee | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 7•16 years ago
|
||
Comment on attachment 311763 [details] [diff] [review] Test switching opening in shared / unshared mode >+ * Portions created by the Initial Developer are Copyright (C) 2007 2008 ;) >+const CONN = >+{ >+ S1 : true, >+ P1 : false, >+ S2 : true, >+ P2 : false nit: no space after [S|P][0-9] >+TestBody.prototype.cleanUp = function cleanUp() note: should probably clean up before and after the test. It looks to me like you could throw during the test and then not cleanup. >+function run_test() >+{ >+ var tb = new TestBody; >+ >+ try { >+ for (var prop in tb) >+ if (prop.match(/^test_/) && typeof(tb[prop]) == "function") >+ tb[prop](); are we counting on the tests to be ran in the order they are declared, or counting on alphabetical order? Either way - seems fragile. I'd much prefer to just do an array of the functions to call like we do in all the other storage tests (in this case, it'd be the array of properties. >+ tb.cleanUp(); oh, I see - you call cleanup here at the end of the test regardless, right? Overall, this test could use a lot more comments. If this test were to fail for someone, I don't expect them to figure out what's wrong and why very quickly at all.
Attachment #311763 -
Flags: review?(sdwilsh) → review-
Assignee | ||
Comment 8•16 years ago
|
||
Fixed nits, added comments, lines cut to 80 characters. I have changed the way the test methods are invoked (although Firefox seems to enumerate properties in the order of their insertion). However, I have avoided listing them. I find it very useful not to do this, because it assures, that there are no unused tests in the code.
Attachment #311689 -
Attachment is obsolete: true
Attachment #311763 -
Attachment is obsolete: true
Attachment #312805 -
Flags: review?(sdwilsh)
Assignee | ||
Comment 9•16 years ago
|
||
I have replaced the numbered tests with array of function names as you have requested. The numbers were not fragile but if someone would want to add a function in the middle, he would have to rename all the methods.
Attachment #312805 -
Attachment is obsolete: true
Attachment #313915 -
Flags: review?(sdwilsh)
Attachment #312805 -
Flags: review?(sdwilsh)
Assignee | ||
Comment 10•16 years ago
|
||
Comment on attachment 313915 [details] [diff] [review] Test switching opening in shared / unshared mode v3 It looks like Shawn is too busy, can you mike make a review?
Attachment #313915 -
Flags: review?(sdwilsh) → review?(shaver)
Updated•16 years ago
|
Whiteboard: [needs review shaver]
Comment on attachment 313915 [details] [diff] [review] Test switching opening in shared / unshared mode v3 r+a=shaver, but please rename CONN to CONN_IS_SHARED or something similar, so that the tests can look like if (CONN_IS_SHARED[conn]) instead of if (CONN[conn]) // if it's shared Thanks for writing these!
Attachment #313915 -
Flags: review?(shaver)
Attachment #313915 -
Flags: review+
Attachment #313915 -
Flags: approval1.9+
Updated•16 years ago
|
Whiteboard: [needs review shaver] → [needs landing]
Assignee | ||
Comment 12•16 years ago
|
||
I cannot check-in myself, so please use this attachment instead. I have fixed readability problem and 80 character lines limit.
Assignee | ||
Comment 13•16 years ago
|
||
Please use attachment #316709 [details] [diff] [review] (v4) for check-in.
Keywords: checkin-needed
Comment 14•16 years ago
|
||
mozilla/storage/test/unit/test_storage_combined_sharing.js 1.1
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in
before you can comment on or make changes to this bug.
Description
•