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
WIP: Add mock server for OpenStack Swift #16
Conversation
Why did test |
I am very glad to have a mock server.
|
Could it be a timing issue? (I don't speak python very well) |
I can reproduce the error with the following and some time (up to an hour! will beep three times when test failed): $ while python -m pytest tests/ -k 'test_retrieve'; do clear; done; echo -ne '\007'; sleep 0.5; echo -ne '\007'; sleep 0.5; echo -ne '\007';
I cannot really see how. I thought that it may be is a problem with pytest-catchlog and included the assertions into the with block but got this, then:
|
@Nikratio I hope it helps a lot. |
That's great, thanks a lot! Regarding running multiple versions of the Swift Mock server: can't you just make a different class for each version, and list them all in Regarding the test: this will have to wait until I have multiple hours of free time in one session. I tried looking at this before, but could not figure out what is happening. |
One thing that one could try is to change the verify code to not just log the messages, but also write them into a file. Then, when the test fails, we could take a look at the file to determine if the corrupted object was really not found, or if there was some issue with the logging system. |
Let's discuss the test failure separately in https://bitbucket.org/nikratio/s3ql/issues/272/t3_verifypy-test_retrieve-sometimes-fails. Maybe for now we can just add an |
ed49fc4
to
8e4605d
Compare
# Without full consistency, deleting an non-existing object
# may not give an error
assert backend.unittest_info.retry_time or len(to_delete) > 0 That's because the backend cannot find Is this assertion vital or can I remove it? |
Hmm. Remind me why the backend cannot figure out what couldn't be deleted? Looking at
Shouldn't this list keys that didn't exist? |
Actually, there's something odd going on in this function: the (see the docstring in AbstractBackend). |
Coming back to the assertion, I think you shouldn't remove it completely but make it conditional so that it's skipped for the swift backend. An |
* Make URL parsing overwritable by sub-classes of S3CRequestHandler * Extract metadata-from-headers-extraction into own function
8e4605d
to
81995ba
Compare
`test_delete_multi` deletes 16 objects – with this change we increase test coverage because the SwiftBackend needs to issue two bulk deletes.
The Swift backend cannot determine which objects actually get deleted. It can only determine which did not got deleted because of errors (excluding 404s). Thus it might mark objects as deleted that actually did not (because they were not found).
The early exit would swallow *all* errors, not only NoSuchObject.
Unfortunately not – this "Errors" list is just for errors besides 404s. In case of 404 only the
OK I removed this early exit for BTW: The S3Backend does the same in |
Yes, it seems S3Backend has the same problem. Thanks for spotting it! |
Merged branch, added https://bitbucket.org/nikratio/s3ql/issues/273/s3delete_multi-force-should-not-suppress for the S3 issue. Thanks! |
Adds a mock server for OpenStack Swift so that the Swift Backend gets more test coverage in default cases (i.e. without tests on live filesystems).
For now the mock server does not handle bulk deletes but copy via COPY. Ideally it would be good to have three different kinds/configurations of the mock server (One that has no special support for anything, one that supports copy via COPY and a third that support bulk delete). But I have no good idea how to do this.
(Since TravisCI is integrated with GitHub I use GitHub for this pull request.)