summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-06 09:37:52 -0700
committerSage Weil <sage@inktank.com>2013-04-06 09:37:52 -0700
commit628e9ae26db0d7765caffd4035903dcaa0429c89 (patch)
treed795c5f69baf0b26df19b771feaf9e44682fb7ac
parent79b71441f8c2a1b282fa0e85badcb7d410c8005d (diff)
downloadceph-628e9ae26db0d7765caffd4035903dcaa0429c89.tar.gz
librbd: fix DiffIterateStress again
- fix seed - the array indices are points in time; no need to subtract one from i! - pick a random seed and print it to stdout I ran this with several different seeds without failure, so I am confident we are in good shape. And if we ever get a future failure, we'll have the seed to reproduce. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/test/librbd/test_librbd.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc
index 38bfbb6cf91..2051b716963 100644
--- a/src/test/librbd/test_librbd.cc
+++ b/src/test/librbd/test_librbd.cc
@@ -1505,7 +1505,7 @@ TEST(LibRBD, FlushAioPP)
int iterate_cb(uint64_t off, size_t len, int exists, void *arg)
{
- cout << "iterate_cb " << off << "~" << len << std::endl;
+ //cout << "iterate_cb " << off << "~" << len << std::endl;
interval_set<uint64_t> *diff = static_cast<interval_set<uint64_t> *>(arg);
diff->insert(off, len);
return 0;
@@ -1701,6 +1701,10 @@ TEST(LibRBD, DiffIterateStress)
ASSERT_EQ("", create_one_pool_pp(pool_name, rados));
ASSERT_EQ(0, rados.ioctx_create(pool_name.c_str(), ioctx));
+ int seed = getpid();
+ cout << "seed " << seed << std::endl;
+ srand(seed);
+
{
librbd::RBD rbd;
librbd::Image image;
@@ -1735,9 +1739,7 @@ TEST(LibRBD, DiffIterateStress)
cout << "from " << i << " to " << j << " diff " << diff << std::endl;
// limit to extents that exists both at the beginning and at the end
- uex = exists[j];
- if (i)
- uex.union_of(exists[i-1]);
+ uex.union_of(exists[i], exists[j]);
diff.intersection_of(uex);
cout << " limited diff " << diff << std::endl;