[education/rkward/testing/win_citest_timeout] rkward: Yet more debug info

Thomas Friedrichsmeier null at kde.org
Sun Oct 2 20:32:08 BST 2022


Git commit 1b181f1a52978ac261d8e6ac5e14737e9c687f12 by Thomas Friedrichsmeier.
Committed on 02/10/2022 at 19:31.
Pushed by tfry into branch 'testing/win_citest_timeout'.

Yet more debug info

M  +7    -0    rkward/autotests/core_test.cpp
M  +2    -0    rkward/rkward.cpp

https://invent.kde.org/education/rkward/commit/1b181f1a52978ac261d8e6ac5e14737e9c687f12

diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index 4475b23c..8bf23828 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -211,18 +211,25 @@ private slots:
 	}
 
 	void restartRBackend() {
+		testLog("a");
 		auto restart_action = RKWardMainWindow::getMain()->actionCollection()->action("restart_r");
 		QVERIFY(restart_action != nullptr);
 		RInterface::issueCommand(new RCommand("x <- 1", RCommand::User));
+		testLog("b");
 		waitForAllFinished();
+		testLog("c");
 		QVERIFY(RObjectList::getGlobalEnv()->findObject("x"));
+		testLog("d");
 
 		QPointer<RInterface> oldiface = RInterface::instance();
 		restart_action->trigger();
+		testLog("e");
 		while (oldiface) {  // action may be delayed until next event processing
+		testLog("f");
 			qApp->processEvents();
 		}
 		waitForBackendStarted();
+		testLog("g");
 
 		// backend should be clean after restart
 		QVERIFY(!RObjectList::getGlobalEnv()->findObject("x"));
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 9672a7f5..db59c030 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -632,6 +632,7 @@ void RKWardMainWindow::initActions() {
 		if (suppressModalDialogsForTesting() || (KMessageBox::warningContinueCancel(this, message, i18n("Restart R backend"), KGuiItem(i18n("Restart R backend"))) == KMessageBox::Continue)) {
 			bool forced = RInterface::instance()->backendIsDead();
 			while (!RInterface::instance()->backendIsDead() && !RInterface::instance()->backendIsIdle()) {
+				RK_DEBUG(APP, DL_DEBUG, "Backend not idle while restart requested.");
 				message = i18n("<p>One or more operations are pending.</p><p>If you have recently chosen to save your workspace, and you see this message, <b>your data may not be saved, yet!</b></p><p>How do you want to proceed?</p>");
 				auto res = KMessageBox::warningYesNoCancel(this, message, i18n("R commands still pending"), KGuiItem(i18n("Force restart now")), KGuiItem(i18n("Check again")), KGuiItem(i18n("Cancel restarting")));
 				if (res == KMessageBox::Yes) {
@@ -647,6 +648,7 @@ void RKWardMainWindow::initActions() {
 			RKWorkplace::mainWorkplace()->closeAll(RKMDIWindow::X11Window);
 			slotCloseAllEditors();
 			auto restart_now = [this]() {
+				RK_DEBUG(APP, DL_DEBUG, "Backend restart now");
 				delete RInterface::instance();  // NOTE: Do not use deleteLater(), here. It is important to fully tear down the old backend, before creating the new one,
 				                                //       as code is written around the assumption that RInterface and friends are singletons. (RInterface::instance(), etc.)
 				RKWorkplace::mainWorkplace()->setWorkspaceURL(QUrl());


More information about the rkward-tracker mailing list