Merge "[FileBackend] Purge Swift process cache before container delete for sanity."

This commit is contained in:
Demon 2012-06-04 20:46:32 +00:00 committed by Gerrit Code Review
commit 0593465614
2 changed files with 7 additions and 4 deletions

View file

@ -1129,7 +1129,7 @@ class SwiftFileBackend extends FileBackendStore {
*
* @param $container string Container name
* @return CF_Container
* @throws InvalidResponseException
* @throws CloudFilesException
*/
protected function createContainer( $container ) {
$conn = $this->getConnection(); // Swift proxy connection
@ -1143,12 +1143,12 @@ class SwiftFileBackend extends FileBackendStore {
*
* @param $container string Container name
* @return void
* @throws InvalidResponseException
* @throws CloudFilesException
*/
protected function deleteContainer( $container ) {
$conn = $this->getConnection(); // Swift proxy connection
$conn->delete_container( $container );
unset( $this->connContainers[$container] ); // purge cache
$conn->delete_container( $container );
}
/**

View file

@ -1392,8 +1392,11 @@ class FileBackendTest extends MediaWikiTestCase {
private function doTestGetFileList() {
$backendName = $this->backendClass();
$base = $this->baseStorePath();
// Should have no errors
$iter = $this->backend->getFileList( array( 'dir' => "$base/unittest-cont-notexists" ) );
$files = array(
"$base/unittest-cont1/test1.txt",
"$base/unittest-cont1/test2.txt",