]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "test/common/test_weighted_priority_queue Fix the unit tests since the"
authorRobert LeBlanc <robert.leblanc@endurance.com>
Wed, 2 Mar 2016 22:07:50 +0000 (22:07 +0000)
committerRobert LeBlanc <robert.leblanc@endurance.com>
Thu, 3 Mar 2016 00:36:18 +0000 (00:36 +0000)
This reverts commit 3a6d6279fe386f9591fdbd8c38fe2fb059dbc398.

Since we added round robin back into the queue, make sure it works
right.

Signed-off-by: Robert LeBlanc <robert.leblanc@endurance.com>
src/test/common/test_weighted_priority_queue.cc

index b8519794b6e1e97ea2e77ca4db63922eb40a9c96..d3ebc4199cfb382c2b6f88f45eb3b5e9ecf4396e 100644 (file)
@@ -114,6 +114,13 @@ protected:
         // in the strict queue.
         LQ::reverse_iterator ri = strictq.rbegin();
         EXPECT_EQ(std::get<0>(r), ri->first);
+        // Check that if there are multiple classes in a priority
+        // that it is not dequeueing the same class each time.
+        LastKlass::iterator si = last_strict.find(std::get<0>(r));
+        if (strictq[std::get<0>(r)].size() > 1 && si != last_strict.end()) {
+         EXPECT_NE(std::get<1>(r), si->second);
+       }
+        last_strict[std::get<0>(r)] = std::get<1>(r);
 
        Item t = strictq[std::get<0>(r)][std::get<1>(r)].front().second;
         EXPECT_EQ(std::get<2>(r), std::get<2>(t));
@@ -125,6 +132,14 @@ protected:
          strictq.erase(std::get<0>(r));
        }
       } else {
+        // Check that if there are multiple classes in a priority
+        // that it is not dequeueing the same class each time.
+        LastKlass::iterator si = last_norm.find(std::get<0>(r));
+        if (normq[std::get<0>(r)].size() > 1 && si != last_norm.end()) {
+         EXPECT_NE(std::get<1>(r), si->second);
+       }
+        last_norm[std::get<0>(r)] = std::get<1>(r);
+
        Item t = normq[std::get<0>(r)][std::get<1>(r)].front().second;
         EXPECT_EQ(std::get<2>(r), std::get<2>(t));
         normq[std::get<0>(r)][std::get<1>(r)].pop_front();