// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include #include #include #include #include #include #include LOG_SETUP(".singlebucketjointest"); using document::test::makeDocumentBucket; using namespace ::testing; namespace storage { struct SingleBucketJoinTest : FileStorTestFixture { }; TEST_F(SingleBucketJoinTest, persistence_can_handle_single_bucket_join) { TestFileStorComponents c(*this); document::BucketId targetBucket(16, 1); document::BucketId sourceBucket(17, 1); createBucket(sourceBucket); // Make sure it's not empty c.sendPut(sourceBucket, DocumentIndex(0), PutTimestamp(1000)); expectOkReply(c.top); c.top.getRepliesOnce(); auto cmd = std::make_shared(makeDocumentBucket(targetBucket)); cmd->getSourceBuckets().push_back(sourceBucket); cmd->getSourceBuckets().push_back(sourceBucket); c.top.sendDown(cmd); // If single bucket join locking is not working properly, this // will hang forever. ASSERT_NO_FATAL_FAILURE(expectOkReply(c.top)); } } // namespace storage