From 53a8f6d21dff425c772d26c43e00a23de98a7b80 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Wed, 7 Jun 2017 11:24:59 +0530 Subject: [PATCH] test/osd: Removed Commented Code - 2 Removed commented code found in test/osd/. Fixes: http://tracker.ceph.com/issues/20207 (Partially) Signed-off-by: Jos Collin --- src/test/osd/Object.cc | 1 - src/test/osd/RadosModel.cc | 2 -- src/test/osd/RadosModel.h | 15 ++------------- src/test/osd/TestOSDMap.cc | 13 ------------- src/test/osd/TestPGLog.cc | 2 -- src/test/osd/TestRados.cc | 3 --- src/test/osd/types.cc | 3 +-- 7 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/test/osd/Object.cc b/src/test/osd/Object.cc index 587e37ee13f56..077146573971f 100644 --- a/src/test/osd/Object.cc +++ b/src/test/osd/Object.cc @@ -35,7 +35,6 @@ std::ostream &operator<<(std::ostream &out, const ContDesc &rhs) return out << "(ObjNum " << rhs.objnum << " snap " << rhs.cursnap << " seq_num " << rhs.seqnum - //<< " prefix " << rhs.prefix << ")"; } diff --git a/src/test/osd/RadosModel.cc b/src/test/osd/RadosModel.cc index 66058b0ceb85d..501bf3b134a22 100644 --- a/src/test/osd/RadosModel.cc +++ b/src/test/osd/RadosModel.cc @@ -12,14 +12,12 @@ void TestOp::begin() { - //if (stat) stat->begin(this); _begin(); } void TestOp::finish(TestOp::CallbackInfo *info) { _finish(info); - //if (stat && finished()) stat->end(this); } void read_callback(librados::completion_t comp, void *arg) { diff --git a/src/test/osd/RadosModel.h b/src/test/osd/RadosModel.h index ff44fee01e97d..0de5e35a9cf03 100644 --- a/src/test/osd/RadosModel.h +++ b/src/test/osd/RadosModel.h @@ -569,7 +569,6 @@ public: i != obj.attrs.end(); ++i, ++iter) { if (!(*iter % 3)) { - //op.rmxattr(i->first.c_str()); to_remove.insert(i->first); op.rmxattr(i->first.c_str()); } @@ -799,7 +798,6 @@ public: context->seq_num++; waiting_on = ranges.size(); - //cout << " waiting_on = " << waiting_on << std::endl; ContentsGenerator::iterator gen_pos = cont_gen->get_iterator(cont); uint64_t tid = 1; for (map::iterator i = ranges.begin(); @@ -2441,7 +2439,7 @@ public: // not being particularly specific here about knowing which // flushes are on the oldest clean snap and which ones are not. can_fail = !blocking || !context->snaps.empty(); - // FIXME: we can could fail if we've ever removed a snap due to + // FIXME: we could fail if we've ever removed a snap due to // the async snap trimming. can_fail = true; cout << num << ": " << (blocking ? "cache_flush" : "cache_try_flush") @@ -2456,9 +2454,6 @@ public: new TestOp::CallbackInfo(0)); completion = context->rados.aio_create_completion((void *) cb_arg, NULL, &write_callback); - // leave object in unused list so that we race with other operations - //context->oid_in_use.insert(oid); - //context->oid_not_in_use.erase(oid); context->oid_flushing.insert(oid); context->oid_not_flushing.erase(oid); context->state_lock.Unlock(); @@ -2484,8 +2479,6 @@ public: context->state_lock.Lock(); assert(!done); assert(completion->is_complete()); - //context->oid_in_use.erase(oid); - //context->oid_not_in_use.insert(oid); context->oid_flushing.erase(oid); context->oid_not_flushing.insert(oid); int r = completion->get_return_value(); @@ -2555,9 +2548,6 @@ public: new TestOp::CallbackInfo(0)); completion = context->rados.aio_create_completion((void *) cb_arg, NULL, &write_callback); - // leave object in unused list so that we race with other operations - //context->oid_in_use.insert(oid); - //context->oid_not_in_use.erase(oid); context->state_lock.Unlock(); op.cache_evict(); @@ -2576,8 +2566,7 @@ public: context->state_lock.Lock(); assert(!done); assert(completion->is_complete()); - //context->oid_in_use.erase(oid); - //context->oid_not_in_use.insert(oid); + int r = completion->get_return_value(); cout << num << ": got " << cpp_strerror(r) << std::endl; if (r == 0) { diff --git a/src/test/osd/TestOSDMap.cc b/src/test/osd/TestOSDMap.cc index 300a38528c653..a99498c0f652b 100644 --- a/src/test/osd/TestOSDMap.cc +++ b/src/test/osd/TestOSDMap.cc @@ -354,16 +354,6 @@ TEST_F(OSDMapTest, KeepsNecessaryTemps) { TEST_F(OSDMapTest, PrimaryAffinity) { set_up_map(); - /* - osdmap.print(cout); - Formatter *f = Formatter::create("json-pretty"); - f->open_object_section("CRUSH"); - osdmap.crush->dump(f); - f->close_section(); - f->flush(cout); - delete f; - */ - int n = get_num_osds(); for (map::const_iterator p = osdmap.get_pools().begin(); p != osdmap.get_pools().end(); @@ -376,7 +366,6 @@ TEST_F(OSDMapTest, PrimaryAffinity) { vector primary(n, 0); test_mappings(0, 10000, &any, &first, &primary); for (int i=0; i primary(n, 0); test_mappings(pool, 10000, &any, &first, &primary); for (int i=0; i= 2) { ASSERT_LT(0, first[i]); @@ -413,7 +401,6 @@ TEST_F(OSDMapTest, PrimaryAffinity) { vector primary(n, 0); test_mappings(pool, 10000, &any, &first, &primary); for (int i=0; i= 2) { ASSERT_LT(0, first[i]); diff --git a/src/test/osd/TestPGLog.cc b/src/test/osd/TestPGLog.cc index 626c3cef57cce..8e10c7532f3a2 100644 --- a/src/test/osd/TestPGLog.cc +++ b/src/test/osd/TestPGLog.cc @@ -1871,7 +1871,6 @@ TEST_F(PGLogTest, filter_log_1) { int num_internal = 10; // Set up splitting map - //ceph::shared_ptr osdmap(new OSDMap()); OSDMap *osdmap = new OSDMap; uuid_d test_uuid; test_uuid.generate_random(); @@ -1909,7 +1908,6 @@ TEST_F(PGLogTest, filter_log_1) { log.log.push_back(e); if (i == 1) log.tail = e.version; - //cout << "object " << e.soid << std::endl; } log.head = e.version; log.index(); diff --git a/src/test/osd/TestRados.cc b/src/test/osd/TestRados.cc index 61759c26ae7d0..b0c5ae7d476bb 100644 --- a/src/test/osd/TestRados.cc +++ b/src/test/osd/TestRados.cc @@ -174,7 +174,6 @@ private: TestOp *gen_op(RadosTestContext &context, TestOpType type) { string oid, oid2; - //cout << "oids not in use " << context.oid_not_in_use.size() << std::endl; assert(context.oid_not_in_use.size()); switch (type) { @@ -465,14 +464,12 @@ int main(int argc, char **argv) set_redirect = true; } else { cerr << "unknown arg " << argv[i] << std::endl; - //usage(); exit(1); } } if (op_weights.empty()) { cerr << "No operations specified" << std::endl; - //usage(); exit(1); } diff --git a/src/test/osd/types.cc b/src/test/osd/types.cc index b4616ea4f2b1f..13159a5d073bc 100644 --- a/src/test/osd/types.cc +++ b/src/test/osd/types.cc @@ -1258,8 +1258,7 @@ TEST(pg_pool_t_test, get_pg_num_divisor) { p.set_pg_num(12); p.set_pgp_num(12); - //cout << "num " << p.get_pg_num() - // << " mask " << p.get_pg_num_mask() << std::endl; + ASSERT_EQ(16u, p.get_pg_num_divisor(pg_t(0, 1))); ASSERT_EQ(16u, p.get_pg_num_divisor(pg_t(1, 1))); ASSERT_EQ(16u, p.get_pg_num_divisor(pg_t(2, 1))); -- 2.39.5