tests: join thread before op= in DBusRAUCServer
Otherwise std::terminate would terminate the process.
It would be encountered in tests if second install operation is invoked
after the first successfully finishes.
Change-Id: I40ef32c13e410543d0cac5bc647c9ce546a8a368
diff --git a/tests/dbus-helpers/dbus_rauc_server.cpp b/tests/dbus-helpers/dbus_rauc_server.cpp
index 230a5d6..94930c3 100644
--- a/tests/dbus-helpers/dbus_rauc_server.cpp
+++ b/tests/dbus-helpers/dbus_rauc_server.cpp
@@ -76,6 +76,9 @@
std::lock_guard<std::mutex> lock(m_mtx);
if (!m_operationInProgress) {
m_operationInProgress = true;
+
+ if (m_installThread.joinable())
+ m_installThread.join();
m_installThread = std::thread(&DBusRAUCServer::installBundle, this);
} else {
throw sdbus::Error("org.gtk.GDBus.UnmappedGError.Quark._g_2dio_2derror_2dquark.Code30", "Already processing a different method");