Skip to content

Commit

Permalink
Make BackupStoreContext::ClearDirectoryCache() public
Browse files Browse the repository at this point in the history
Needed to clear the cache in backupstore tests specialised for S3.
  • Loading branch information
qris committed Sep 28, 2017
1 parent 4774b1d commit 03cd458
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/backupstore/BackupStoreContext.h
Expand Up @@ -198,12 +198,15 @@ class BackupStoreContext
const std::string& GetConnectionDetails() { return mConnectionDetails; }
virtual int GetBlockSize() { return mpFileSystem->GetBlockSize(); }

// This is not an API, but it's useful in tests with multiple contexts, to allow
// synchronisation between them:
void ClearDirectoryCache();

private:
BackupStoreDirectory &GetDirectoryInternal(int64_t ObjectID,
bool AllowFlushCache = true);
void SaveDirectory(BackupStoreDirectory &rDir);
void RemoveDirectoryFromCache(int64_t ObjectID);
void ClearDirectoryCache();
void DeleteDirectoryRecurse(int64_t ObjectID, bool Undelete);
int64_t AllocateObjectID();

Expand Down
2 changes: 1 addition & 1 deletion test/backupstore/testbackupstore.cpp
Expand Up @@ -1692,7 +1692,7 @@ bool test_server_commands()
TEST_THAT(changereply->GetObjectID() == subdirid);
}

// Check the new attributes
// Check the new attributes using the read-only connection
{
// Command
protocolReadOnly.QueryListDirectory(
Expand Down

0 comments on commit 03cd458

Please sign in to comment.