diff options
author | Henning Baldersheim <balder@oath.com> | 2018-06-17 22:35:07 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-06-17 22:35:07 +0200 |
commit | 8926abb4432ca8ab0ccae3ee6e9b4f376d37ecbf (patch) | |
tree | 83d4f7131db9fe5b52da1c2cb7f713f034da4875 /searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp | |
parent | 8076e0074b86d5d4e44bc459593ab1b54f744a7c (diff) |
- Remove the execute(string, ...) and force the use of ExecutorId.
- Remove some double bookkeeping in AttributeWriter.
- Ensure that we always use attribute.getNamePrefix() to compute executor id.
Diffstat (limited to 'searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp')
-rw-r--r-- | searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp b/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp index 805a6d3b962..f8ab03d7710 100644 --- a/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp +++ b/searchlib/src/tests/common/sequencedtaskexecutor/sequencedtaskexecutor_test.cpp @@ -122,8 +122,8 @@ TEST_F("require that task with same string component id are serialized", Fixture std::shared_ptr<TestObj> tv(std::make_shared<TestObj>()); EXPECT_EQUAL(0, tv->_val); auto test2 = [=]() { tv->modify(14, 42); }; - f._threads.execute("0", [=]() { usleep(2000); tv->modify(0, 14); }); - f._threads.execute("0", test2); + f._threads.execute(f._threads.getExecutorId("0"), [=]() { usleep(2000); tv->modify(0, 14); }); + f._threads.execute(f._threads.getExecutorId("0"), test2); tv->wait(2); EXPECT_EQUAL(0, tv->_fail); EXPECT_EQUAL(42, tv->_val); @@ -132,8 +132,7 @@ TEST_F("require that task with same string component id are serialized", Fixture EXPECT_EQUAL(42, tv->_val); } -namespace -{ +namespace { int detectSerializeFailure(Fixture &f, vespalib::stringref altComponentId, int tryLimit) { @@ -141,8 +140,8 @@ int detectSerializeFailure(Fixture &f, vespalib::stringref altComponentId, int t for (tryCnt = 0; tryCnt < tryLimit; ++tryCnt) { std::shared_ptr<TestObj> tv(std::make_shared<TestObj>()); EXPECT_EQUAL(0, tv->_val); - f._threads.execute("0", [=]() { usleep(2000); tv->modify(0, 14); }); - f._threads.execute(altComponentId, [=]() { tv->modify(14, 42); }); + f._threads.execute(f._threads.getExecutorId("0"), [=]() { usleep(2000); tv->modify(0, 14); }); + f._threads.execute(f._threads.getExecutorId(altComponentId), [=]() { tv->modify(14, 42); }); tv->wait(2); if (tv->_fail != 1) { continue; |