Skip to content

Commit

Permalink
test/osd: Removed Commented Code - 2
Browse files Browse the repository at this point in the history
Removed commented code found in test/osd/.

Fixes: http://tracker.ceph.com/issues/20207 (Partially)

Signed-off-by: Jos Collin <[email protected]>
  • Loading branch information
joscollin committed Jun 20, 2017
1 parent 10a2281 commit 53a8f6d
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 36 deletions.
1 change: 0 additions & 1 deletion src/test/osd/Object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
<< ")";
}

Expand Down
2 changes: 0 additions & 2 deletions src/test/osd/RadosModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 2 additions & 13 deletions src/test/osd/RadosModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ class RemoveAttrsOp : public TestOp {
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());
}
Expand Down Expand Up @@ -799,7 +798,6 @@ class WriteOp : public TestOp {
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<uint64_t, uint64_t>::iterator i = ranges.begin();
Expand Down Expand Up @@ -2441,7 +2439,7 @@ class CacheFlushOp : public TestOp {
// 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")
Expand All @@ -2456,9 +2454,6 @@ class CacheFlushOp : public TestOp {
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();
Expand All @@ -2484,8 +2479,6 @@ class CacheFlushOp : public TestOp {
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();
Expand Down Expand Up @@ -2555,9 +2548,6 @@ class CacheEvictOp : public TestOp {
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();
Expand All @@ -2576,8 +2566,7 @@ class CacheEvictOp : public TestOp {
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) {
Expand Down
13 changes: 0 additions & 13 deletions src/test/osd/TestOSDMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t,pg_pool_t>::const_iterator p = osdmap.get_pools().begin();
p != osdmap.get_pools().end();
Expand All @@ -376,7 +366,6 @@ TEST_F(OSDMapTest, PrimaryAffinity) {
vector<int> primary(n, 0);
test_mappings(0, 10000, &any, &first, &primary);
for (int i=0; i<n; ++i) {
//cout << "osd." << i << " " << any[i] << " " << first[i] << " " << primary[i] << std::endl;
ASSERT_LT(0, any[i]);
ASSERT_LT(0, first[i]);
ASSERT_LT(0, primary[i]);
Expand All @@ -391,7 +380,6 @@ TEST_F(OSDMapTest, PrimaryAffinity) {
vector<int> primary(n, 0);
test_mappings(pool, 10000, &any, &first, &primary);
for (int i=0; i<n; ++i) {
//cout << "osd." << i << " " << any[i] << " " << first[i] << " " << primary[i] << std::endl;
ASSERT_LT(0, any[i]);
if (i >= 2) {
ASSERT_LT(0, first[i]);
Expand All @@ -413,7 +401,6 @@ TEST_F(OSDMapTest, PrimaryAffinity) {
vector<int> primary(n, 0);
test_mappings(pool, 10000, &any, &first, &primary);
for (int i=0; i<n; ++i) {
//cout << "osd." << i << " " << any[i] << " " << first[i] << " " << primary[i] << std::endl;
ASSERT_LT(0, any[i]);
if (i >= 2) {
ASSERT_LT(0, first[i]);
Expand Down
2 changes: 0 additions & 2 deletions src/test/osd/TestPGLog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,6 @@ TEST_F(PGLogTest, filter_log_1) {
int num_internal = 10;

// Set up splitting map
//ceph::shared_ptr<OSDMap> osdmap(new OSDMap());
OSDMap *osdmap = new OSDMap;
uuid_d test_uuid;
test_uuid.generate_random();
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions src/test/osd/TestRados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ class WeightedTestGenerator : public TestOpGenerator
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) {
Expand Down Expand Up @@ -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);
}

Expand Down
3 changes: 1 addition & 2 deletions src/test/osd/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 53a8f6d

Please sign in to comment.