Skip to content

Commit 91a0632

Browse files
committed
test/librados_test_stub: unbreak selfmanaged_snap_rollback()
After the rollback assert in TestGroup.add_snapshot{,PP} was made meaningful in the previous commit, it fails in mock tests which means that rollback has never been exercised properly... While I confess to not following file->snap_id == CEPH_NOSNAP branch especially given how file variable is shadowed, it's pretty clear that get_snap_read() doesn't belong here -- the snapshot selected for reads has nothing to do with rollback. Replacing it with the rollback snap ID makes sense of the other branches and makes the tests in question pass. Signed-off-by: Ilya Dryomov <[email protected]>
1 parent b3977c5 commit 91a0632

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/librados_test_stub/TestMemIoCtxImpl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ int TestMemIoCtxImpl::selfmanaged_snap_rollback(const std::string& oid,
479479
for (TestMemCluster::FileSnapshots::reverse_iterator it = snaps.rbegin();
480480
it != snaps.rend(); ++it) {
481481
TestMemCluster::SharedFile file = *it;
482-
if (file->snap_id < get_snap_read()) {
482+
if (file->snap_id < snapid) {
483483
if (versions == 0) {
484484
// already at the snapshot version
485485
return 0;

0 commit comments

Comments
 (0)