-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[3/5] Clustered Purge - Rewrite pluggable storage engine tests #1368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3/5] Clustered Purge - Rewrite pluggable storage engine tests #1368
Conversation
| ok = couch_server:delete(couch_db:name(Db), []). | ||
|
|
||
|
|
||
| cpse_read_empty_docs(Db) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name of the test is misleading. For some reason I read the test name as "Read documents which are empty". It could be just me though.
cpse_read_missing_docs or cpse_read_non_existent_docs would be better IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpse_read_docs_from_empty_db is also an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to cpse_read_docs_from_empty_db/1
| ?assertEqual(?NUM_CLIENTS + 2, length(Pids1)), | ||
| Pids1 = couch_db_engine:monitored_by(Db), | ||
| % +3 for self, db pid, and process tracker | ||
| ?assertEqual(?NUM_CLIENTS + 3, length(Pids1)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use couch_db:monitored_by/1, which would remove db and process tracker. However we probably want to limit functions we use to couch_db_engine module. I am really not sure which approach is better. Just wanted to mention it so I don't forget why I stopped here.
e2bbbf0 to
826b17e
Compare
8cbf976 to
966497c
Compare
826b17e to
163b02e
Compare
966497c to
b663478
Compare
6a370e6 to
bff390d
Compare
|
+1 but squerge that merge conflict to the commit it goes in. |
b663478 to
da43788
Compare
bff390d to
4c87d78
Compare
|
Thanks @davisp I already squashed that merge conflict to the commit it goes in. |
169e84c to
391d7b5
Compare
It turns out that if any storage engine has to open itself during a callback it would end up violating the guarantee of a single writer. This change in the test suite changes things to use couch_server so that storage engines are now free to do as they want reopening themselves.
4c87d78 to
e0c7ad3
Compare
This PR updates the pluggable storage engine test suite so that its a self contained app to clean up code and various other odds and ends.
The biggest change is that this also makes the tests go through couch_server instead of instantiating the engines directly. This allows a storage engine to open itself as a database which turned out to be necessary for compactions with purge so that we can enable code re-use without requiring every engine to correctly implement the get_minimum_purge_seq logic.
This PR depends on #1366 and #1367.