Reduce EphTombstoneTest/ConcurrentPurge runtime 94/77894/3
authorJames Harrison <00jamesh@gmail.com>
Tue, 9 May 2017 15:09:02 +0000 (16:09 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 10 May 2017 08:49:25 +0000 (08:49 +0000)
Reduced the number of documents used, and inserted a yield.

Change-Id: I54b787110e2195b52ec2576c1a4d49cfffc73355
Reviewed-on: http://review.couchbase.org/77894
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
tests/module_tests/ephemeral_vb_test.cc

index 35d8488..f224358 100644 (file)
@@ -435,7 +435,7 @@ TEST_F(EphTombstoneTest, ConcurrentPurge) {
     auto writer = [this](
             ThreadGate& started, std::atomic<size_t>& completed, size_t id) {
         started.threadUp();
     auto writer = [this](
             ThreadGate& started, std::atomic<size_t>& completed, size_t id) {
         started.threadUp();
-        for (size_t ii = 0; ii < 5000; ++ii) {
+        for (size_t ii = 0; ii < 1000; ++ii) {
             auto key = makeStoredDocKey(std::to_string(id) + ":key_" +
                                         std::to_string(ii));
             Item item(key, /*flags*/ 0, /*expiry*/ 0, key.data(), key.size());
             auto key = makeStoredDocKey(std::to_string(id) + ":key_" +
                                         std::to_string(ii));
             Item item(key, /*flags*/ 0, /*expiry*/ 0, key.data(), key.size());
@@ -450,6 +450,7 @@ TEST_F(EphTombstoneTest, ConcurrentPurge) {
     size_t purged = 0;
     do {
         purged += mockEpheVB->purgeTombstones(0);
     size_t purged = 0;
     do {
         purged += mockEpheVB->purgeTombstones(0);
+        std::this_thread::yield();
     } while (completed != 2);
 
     fe1.join();
     } while (completed != 2);
 
     fe1.join();