aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-06-07 07:34:57 +0200
committerHenning Baldersheim <balder@oath.com>2018-06-12 22:50:28 +0200
commit6c04171843d0d9ebc99f6b91303a76c62eb2aef4 (patch)
tree338ffa8e190c93ef4abab1ebd1ac79036c74cfd2 /storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
parent047ea0bed80966554e29a1db1b35361d946a3866 (diff)
1 - Use a backing buffer for the DocumentUpdate that always is source of truth.
2 - Use this buffer for re-serialization. 3 - Make deserialization lazy where possible. Currently lazy on replay and when arriving over the storageapi. Still needs to eager over documentapi. 4 - Deserialize eagerly in the persistence thread since those are plentyfull and not bottlenecked, instead of in the single master thread. Use real repo.
Diffstat (limited to 'storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp')
-rw-r--r--storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp b/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
index 7df598bed97..98ad8761736 100644
--- a/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
+++ b/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
@@ -597,25 +597,19 @@ ChangedBucketOwnershipHandlerTest::testAbortOutdatedPutOperation()
void
ChangedBucketOwnershipHandlerTest::testAbortOutdatedUpdateCommand()
{
- const document::DocumentType* docType(_testDocRepo.getTypeRepo()
- .getDocumentType("testdoctype1"));
+ const document::DocumentType* docType(_testDocRepo.getTypeRepo().getDocumentType("testdoctype1"));
document::DocumentId docId("id:foo:testdoctype1::bar");
- document::DocumentUpdate::SP update(
- std::make_shared<document::DocumentUpdate>(*docType, docId));
- CPPUNIT_ASSERT(changeAbortsMessage<api::UpdateCommand>(
- getBucketToAbort(), update, api::Timestamp(1234)));
- CPPUNIT_ASSERT(!changeAbortsMessage<api::UpdateCommand>(
- getBucketToAllow(), update, api::Timestamp(1234)));
+ auto update(std::make_shared<document::DocumentUpdate>(_testDocRepo.getTypeRepo(), *docType, docId));
+ CPPUNIT_ASSERT(changeAbortsMessage<api::UpdateCommand>(getBucketToAbort(), update, api::Timestamp(1234)));
+ CPPUNIT_ASSERT(!changeAbortsMessage<api::UpdateCommand>(getBucketToAllow(), update, api::Timestamp(1234)));
}
void
ChangedBucketOwnershipHandlerTest::testAbortOutdatedRemoveCommand()
{
document::DocumentId docId("id:foo:testdoctype1::bar");
- CPPUNIT_ASSERT(changeAbortsMessage<api::RemoveCommand>(
- getBucketToAbort(), docId, api::Timestamp(1234)));
- CPPUNIT_ASSERT(!changeAbortsMessage<api::RemoveCommand>(
- getBucketToAllow(), docId, api::Timestamp(1234)));
+ CPPUNIT_ASSERT(changeAbortsMessage<api::RemoveCommand>(getBucketToAbort(), docId, api::Timestamp(1234)));
+ CPPUNIT_ASSERT(!changeAbortsMessage<api::RemoveCommand>(getBucketToAllow(), docId, api::Timestamp(1234)));
}
void