diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-23 21:09:08 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-23 21:21:34 +0000 |
commit | 2d1f4ba77c803a7bdb9f4a2f0bd31b6208011f82 (patch) | |
tree | 0fb95d10334300368a147af2fc9e335b8d4c9b5f /storage/src/tests/persistence/filestorage/filestormanagertest.cpp | |
parent | fcfe291173a6a6f14a77abec96709383fee21866 (diff) |
- Change error handling so that both synchonous and asynchronous errors can be reported back from bucket executor.
- Treat remapping as an error.
- For lidspace compaction job iterator is reset and will be recreated on next invocation.
- For bucketmove th ebucket is rechecked and either discarded or restarted.
Diffstat (limited to 'storage/src/tests/persistence/filestorage/filestormanagertest.cpp')
-rw-r--r-- | storage/src/tests/persistence/filestorage/filestormanagertest.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index 290a3574209..891c0e5dace 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -425,14 +425,13 @@ TEST_F(FileStorManagerTest, running_task_against_unknown_bucket_fails) { ASSERT_TRUE(executor); spi::Bucket b1 = makeSpiBucket(document::BucketId(1)); - std::atomic<size_t> numInvocations(0); - auto response = executor->execute(b1, spi::makeBucketTask([&numInvocations](const spi::Bucket &, std::shared_ptr<IDestructorCallback>) { - numInvocations++; - })); - ASSERT_TRUE(response); - EXPECT_EQ(0, numInvocations); - response->run(spi::Bucket(), {}); - EXPECT_EQ(1, numInvocations); + std::atomic<size_t> success(0); + std::atomic<size_t> failures(0); + auto task = spi::makeBucketTask([&success](const spi::Bucket &, std::shared_ptr<IDestructorCallback>) { success++;}, + [&failures](const spi::Bucket &) { failures++; }); + executor->execute(b1, std::move(task)); + EXPECT_EQ(0, success); + EXPECT_EQ(1, failures); } TEST_F(FileStorManagerTest, running_task_against_existing_bucket_works) { @@ -448,15 +447,16 @@ TEST_F(FileStorManagerTest, running_task_against_existing_bucket_works) { createBucket(b1.getBucketId()); - std::atomic<size_t> numInvocations(0); + std::atomic<size_t> success(0); + std::atomic<size_t> failures(0); vespalib::Gate gate; - auto response = executor->execute(b1, spi::makeBucketTask([&numInvocations, &gate](const spi::Bucket &, std::shared_ptr<IDestructorCallback>) { - numInvocations++; + executor->execute(b1, spi::makeBucketTask([&success, &gate](const spi::Bucket &, std::shared_ptr<IDestructorCallback>) { + success++; gate.countDown(); - })); - EXPECT_FALSE(response); + }, [&failures](const spi::Bucket &) { failures++; })); gate.await(); - EXPECT_EQ(1, numInvocations); + EXPECT_EQ(1, success); + EXPECT_EQ(0, failures); } TEST_F(FileStorManagerTest, state_change) { |