diff options
author | Tor Egge <Tor.Egge@online.no> | 2021-11-16 14:07:51 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2021-11-16 14:07:51 +0100 |
commit | 07c5fdd2c019e69b32e0d725c98b47f86691d7c6 (patch) | |
tree | 73124e8dc8e6a6861e316f07a09abf7440121378 /searchcore/src/tests/proton/attribute/attribute_test.cpp | |
parent | bf366caae591f98c0dd002574f3f7de465746fd6 (diff) |
Use GateCallback to signal completion of force commit.
Diffstat (limited to 'searchcore/src/tests/proton/attribute/attribute_test.cpp')
-rw-r--r-- | searchcore/src/tests/proton/attribute/attribute_test.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp index 2151556b89d..d4ad85d88d9 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -42,9 +42,11 @@ #include <vespa/vespalib/gtest/gtest.h> #include <vespa/vespalib/io/fileutil.h> #include <vespa/vespalib/test/insertion_operators.h> +#include <vespa/vespalib/util/destructor_callbacks.h> #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/foreground_thread_executor.h> #include <vespa/vespalib/util/foregroundtaskexecutor.h> +#include <vespa/vespalib/util/gate.h> #include <vespa/vespalib/util/sequencedtaskexecutorobserver.h> #include <vespa/log/log.h> @@ -86,6 +88,7 @@ using vespalib::eval::SimpleValue; using vespalib::eval::TensorSpec; using vespalib::eval::Value; using vespalib::eval::ValueType; +using vespalib::GateCallback; using vespalib::IDestructorCallback; using AVBasicType = search::attribute::BasicType; @@ -199,8 +202,9 @@ public: EXPECT_EQ(includeCommit, _attributeFieldWriter->getExecuteHistory()); } SerialNum test_force_commit(AttributeVector &attr, SerialNum serialNum) { - commit(serialNum); - _attributeFieldWriter->sync_all(); + vespalib::Gate gate; + _aw->forceCommit(serialNum, std::make_shared<GateCallback>(gate)); + gate.await(); return attr.getStatus().getLastSyncToken(); } }; |