]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados_api_tier_pp: tolerate ENOENT or success from deleted snap
authorSage Weil <sage@redhat.com>
Sun, 30 Jun 2019 20:06:37 +0000 (15:06 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 13:37:51 +0000 (08:37 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/librados/tier_cxx.cc

index 885755279014b52d7a62e594e46d41c69e47429e..0f5c4ef2d8e87e7bfd11539fcafe4c3a51c33d3e 100644 (file)
@@ -633,10 +633,12 @@ TEST_F(LibRadosTwoPoolsPP, PromoteSnapTrimRace) {
 
   ioctx.snap_set_read(my_snaps[0]);
 
-  // read foo snap
+  // read foo snap.  the OSD may or may not realize that this snap has
+  // been logically deleted; either response is valid.
   {
     bufferlist bl;
-    ASSERT_EQ(-ENOENT, ioctx.read("foo", bl, 1, 0));
+    int r = ioctx.read("foo", bl, 1, 0);
+    ASSERT_TRUE(r == 1 || r == -ENOENT);
   }
 
   // cleanup
@@ -3961,10 +3963,12 @@ TEST_F(LibRadosTwoPoolsECPP, PromoteSnapTrimRace) {
 
   ioctx.snap_set_read(my_snaps[0]);
 
-  // read foo snap
+  // read foo snap.  the OSD may or may not realize that this snap has
+  // been logically deleted; either response is valid.
   {
     bufferlist bl;
-    ASSERT_EQ(-ENOENT, ioctx.read("foo", bl, 1, 0));
+    int r = ioctx.read("foo", bl, 1, 0);
+    ASSERT_TRUE(r == 1 || r == -ENOENT);
   }
 
   // cleanup