From 3ea5799cde2521e410a9c210b63816ca3a064ccd Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Mon, 11 Dec 2017 22:56:40 +0200 Subject: [PATCH] test/rbd_mirror: "use of uninitialised value" valgrind warning The `on_call` context serves as a barrier and should be completed after the `on_start_ctx` context is assigned. The warning was observed sporadically e.g. by repeating WaitingOnNonLeaderAcquireLeader test under valgrind. Signed-off-by: Mykola Golub --- src/test/rbd_mirror/test_mock_InstanceWatcher.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/rbd_mirror/test_mock_InstanceWatcher.cc b/src/test/rbd_mirror/test_mock_InstanceWatcher.cc index 69497d3918c..3cb860e6699 100644 --- a/src/test/rbd_mirror/test_mock_InstanceWatcher.cc +++ b/src/test/rbd_mirror/test_mock_InstanceWatcher.cc @@ -692,14 +692,14 @@ public: EXPECT_CALL(mock_image_sync_throttler, start_op(sync_id, _)) .WillOnce(Invoke([on_call, on_start_ctx] (const std::string &, Context *ctx) { - if (on_call != nullptr) { - on_call->complete(0); - } if (on_start_ctx != nullptr) { *on_start_ctx = ctx; } else { ctx->complete(0); } + if (on_call != nullptr) { + on_call->complete(0); + } })); }