Add functional test for delete collection then post scenario#62
Add functional test for delete collection then post scenario#62mostlygeek wants to merge 5 commits intomasterfrom
Conversation
A bug was discovered in gosync (issue #169) where a DELETE of a collection followed by a POST had the wrong behaviour. Add test_delete_collection_then_post to ensure all servers conform to the expected behaviour by clients.
| res = resp.json | ||
| self.assertTrue("col2" in res) | ||
|
|
||
| infoBefore = self.app.get(self.root + '/info/collections') |
There was a problem hiding this comment.
How is this different from the previous resp on L588?
|
|
||
| # post BSOs again with X-I-U-S == 0 | ||
| self.app.post_json( | ||
| self.root + '/storage/col2', bsos, |
| items = self.app.get(self.root + '/storage/col2').json | ||
| self.assertEquals(len(items), 0) | ||
| self.app.post_json( | ||
| self.root + '/storage/col2', bsos, |
086ccb9 to
e3f9bc5
Compare
rfk
left a comment
There was a problem hiding this comment.
This LGTM apart from test nits, I'll push some tweaks and merge.
| self.assertTrue("X-Last-Modified" in infoBefore.headers) | ||
| self.assertTrue("X-Last-Modified" in infoAfter1.headers) | ||
| self.assertNotEqual(infoBefore.headers["X-Last-Modified"], | ||
| infoAfter1.headers["X-Last-Modified"]) |
There was a problem hiding this comment.
We should be able to assert that after is greater than before, not just that they're unequal.
| headers=[('X-If-Unmodified-Since', "0.00")]) | ||
| infoAfter3 = self.app.get(self.root + '/info/collections') | ||
| self.assertNotEqual(infoAfter3.headers["X-Last-Modified"], | ||
| infoAfter2.headers["X-Last-Modified"]) |
Oh snap, I think adding a strict ordering check in the tests has uncovered a bug in the python server. I will see about a fix and push for re-review. |
|
The python server is doing this to determine the overall storage timestamp: Which is obviously wrong, for the same reason that just taking the max modified time of a BSO is wrong for a collection. |
|
@bbangert I'd be curious whether the new spanner backend can or could pass this additional functional test, which the python backend currently doesn't. |
|
Flagging this for @pjenvey lest we forget it forever. |
A bug was discovered in gosync (issue #169) where a DELETE of a
collection followed by a POST had the wrong behaviour. Add
test_delete_collection_then_post to ensure all servers conform to the
expected behaviour by clients.
The gosync issue #169 contains more context on this issue.