Merge lp:~andrew-haigh-b/cdts/bug1218846 into lp:cdts

Proposed by Andrew Haigh
Status: Rejected
Rejected by: Zygmunt Krynicki
Proposed branch: lp:~andrew-haigh-b/cdts/bug1218846
Merge into: lp:cdts
Diff against target: 117 lines (+14/-39)
2 files modified
plainbox-gui/gui-engine/gui-engine.cpp (+13/-38)
plainbox-gui/gui-engine/gui-engine.h (+1/-1)
To merge this branch: bzr merge lp:~andrew-haigh-b/cdts/bug1218846
Reviewer Review Type Date Requested Status
Registry Administrators Pending
Review via email: mp+183224@code.launchpad.net

Description of the change

This MR fixes the linked bug by removing unnecessary dbus calls when processing a job result.
The UI is now much more responsive.

Note that this eliminates the QML warning about missing "outcome" for the manual interaction dialog, and avoids a (small) memory leak when gathering the outcome.

Please review individual commits for details.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

I tested this by merging this branch on checkbox-ihv-ng rev 2278.

I had to change the interface name to com.canonical.certification.PlainBox1 on line 35 of PBNames.h.

Then I observed some weird behavior (against plainbox from checkbox trunk rev 2335).

I started plainbox service, then the gui client. I selected only the default whitelist.

I deselected all the tests, then selected all the camera tests. This contains at least two manual tests (camera/still and camera/display). Then I started the test run.

camera/display runs first and I get a live video window but the manual test window that pops up is for camera/still. Once the live video window closes, I get another capture window but for a static image (meaning, that's the command for camera/still). An outcome of "No" is selected once the static image closes. Then I click on "continue" and the client crashes with a message (following).

So first, it seems to be running the command for a manual job as soon as it hits the manual job (not waiting for me to press "test"). Then capturing the test outcome seems to be wrong. Finally, it shouldn't crash at the end :(

uiEngine::PrepareJobs()

Time for summary: 29
Start Testing
Running Job "package"
Real outcome "pass"
Running Job "device"
Real outcome "pass"
Running Job "camera/detect"
Real outcome "pass"
Running Job "camera/display"
GuiEngine::CatchallAskForOutcomeSignalsHandler
Real outcome ""
GuiEngine::CatchallAskForOutcomeSignalsHandler - Done
Real outcome "none"
Running Job "camera/still"
GuiEngine::CatchallAskForOutcomeSignalsHandler
Real outcome ""
updateManualInteractionDialog
GuiEngine::CatchallAskForOutcomeSignalsHandler - Done
Real outcome "none"
onJobsCompleted
Continue
GuiEngine::ResumeFromManualInteraction()
GuiEngine::SetOutcome
GuiEngine::SetOutcome - Done
GuiEngine::ResumeFromManualInteraction()
Real outcome "pass"
ASSERT failure in QList<T>::at: "index out of range", file /usr/include/qt5/QtCore/qlist.h, line 454
The program has unexpectedly finished.
/media/bulk/checkboxes/checkbox-ihv-ng/trunk/build-plainbox-gui-Desktop-Debug/driver-testing/driver-testing exited with code 0

I was able to reproduce this with stubbox leaving all three whitelists selected, it just blasts through all the manual test windows and then crashes when I click on "continue" on the manual test window, which shows stub/dependency/good (it shouldn't as that's an automated job).

Unmerged revisions

2280. By Andrew Haigh

Ensure that the outcome is signalled to the manual interaction screen and avoid the qml missing outcome error. Note that this could usefully be updated to read the assumed result but this is another piece of work.

2279. By Andrew Haigh

Borrowed wip updates from spineau

2278. By Daniel Manrique

Merged from lp:checkbox

2277. By Brendan Donegan

"automatic merge by tarmac [r=zkrynicki][bug=][author=brendan-donegan]"

2276. By Brendan Donegan

"automatic merge by tarmac [r=zkrynicki][bug=][author=brendan-donegan]"

2275. By Andrew Haigh

"automatic merge by tarmac [r=roadmr][bug=1214911][author=andrew-haigh-b]"

2274. By Daniel Manrique

Merged from lp:checkbox

2273. By Daniel Manrique

Merged Hiding any groups or tests not selected by the user when showing the run manager, by Andrew Haigh

2272. By Daniel Manrique

Merged activity spinner and better test counting, by Andrew Haigh

The ActivityIndicator spinner replaces the suite selection whilst generating local jobs

Added Ubuntu ActivityIndicator to the Manual Interaction Dialog

Added a count of the implicitly run tests to the Test Selection Screen. Note: This should also take care of bug #1211791 Plainbox runs test not selected in Test Selection screen.

2271. By Andrew Haigh

"automatic merge by tarmac [r=roadmr][bug=][author=andrew-haigh-b]"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plainbox-gui/gui-engine/gui-engine.cpp'
--- plainbox-gui/gui-engine/gui-engine.cpp 2013-08-21 11:41:50 +0000
+++ plainbox-gui/gui-engine/gui-engine.cpp 2013-08-30 15:57:58 +0000
@@ -576,7 +576,7 @@
576* Selection screen as additional implicit jobs576* Selection screen as additional implicit jobs
577*/577*/
578578
579int GuiEngine::PrepareJobs(void) 579int GuiEngine::PrepareJobs(void)
580{580{
581581
582 qDebug("\n\nGuiEngine::PrepareJobs()\n");582 qDebug("\n\nGuiEngine::PrepareJobs()\n");
@@ -1290,15 +1290,8 @@
1290 QString job_cmd = GetCommand(m_run_list.at(m_current_job_index));1290 QString job_cmd = GetCommand(m_run_list.at(m_current_job_index));
12911291
12921292
1293 // Get the interim Job Results
1294 GetJobStateMap();
1295
1296 GetJobStates();
1297
1298 GetJobResults();
1299
1300 // we should look up the prior job result if available1293 // we should look up the prior job result if available
1301 int outcome = GetOutcomeFromJobPath(m_run_list.at(m_current_job_index));1294 int outcome = GetOutcomeFromJobResultPath(m_run_list.at(m_current_job_index));
13021295
1303 // Open the GUI dialog -- TODO - Default the Yes/No/Skip icons1296 // Open the GUI dialog -- TODO - Default the Yes/No/Skip icons
1304 if (!m_running_manual_job) {1297 if (!m_running_manual_job) {
@@ -1310,7 +1303,6 @@
1310 emit updateManualInteractionDialog(outcome);1303 emit updateManualInteractionDialog(outcome);
1311 }1304 }
13121305
1313
1314 qDebug("GuiEngine::CatchallAskForOutcomeSignalsHandler - Done");1306 qDebug("GuiEngine::CatchallAskForOutcomeSignalsHandler - Done");
1315}1307}
13161308
@@ -1350,6 +1342,9 @@
1350 case PBTreeNode::PBJobResult_Skip:1342 case PBTreeNode::PBJobResult_Skip:
1351 return JobResult_OUTCOME_SKIP;1343 return JobResult_OUTCOME_SKIP;
1352 break;1344 break;
1345
1346 default:
1347 return JobResult_OUTCOME_NONE;
1353 }1348 }
1354}1349}
13551350
@@ -1638,15 +1633,8 @@
16381633
1639 UpdateJobResult(m_session,job,result);1634 UpdateJobResult(m_session,job,result);
16401635
1641 // Get the interim Job Results1636 // How did this job turn out?
1642 GetJobStateMap();1637 int outcome = GetOutcomeFromJobResultPath(result);
1643
1644 GetJobStates();
1645
1646 GetJobResults();
1647
1648 // How did this job turn out?
1649 int outcome = GetOutcomeFromJobPath(m_run_list.at(m_current_job_index));
16501638
1651 // Update the GUI so it knows what the job outcome was1639 // Update the GUI so it knows what the job outcome was
1652 emit updateGuiObjects(m_run_list.at(m_current_job_index).path(), \1640 emit updateGuiObjects(m_run_list.at(m_current_job_index).path(), \
@@ -1769,33 +1757,20 @@
1769 return empty;1757 return empty;
1770}1758}
17711759
1772const int GuiEngine::GetOutcomeFromJobPath(const QDBusObjectPath &opath)1760const int GuiEngine::GetOutcomeFromJobResultPath(const QDBusObjectPath &opath)
1773{1761{
1774 QString outcome;1762 QString outcome;
1775 int result = 0;
17761763
1777 /* first, we need to go through the m_job_state_list to find the1764 /* first, we need to go through the m_job_state_list to find the
1778 * relevant job to result mapping. then we go through m_job_state_results1765 * relevant job to result mapping. then we go through m_job_state_results
1779 * to obtain the actual result.1766 * to obtain the actual result.
1780 */1767 */
17811768
1782 QDBusObjectPath resultpath;1769 PBTreeNode* result_node = new PBTreeNode();
17831770 result_node->AddNode(result_node, opath);
1784 for(int i=0; i < m_job_state_list.count(); i++) {1771 outcome = result_node->outcome();
1785 if (m_job_state_list.at(i)->job().path().compare(opath.path()) == 0) {1772
1786 // ok, we found the right statelist entry1773 delete result_node;
1787 resultpath = m_job_state_list.at(i)->result();
1788 break;
1789 }
1790 }
1791
1792 // Now to find the right result object
1793 for(int i=0;i<m_job_state_results.count();i++) {
1794 if (m_job_state_results.at(i)->object_path.path().compare(resultpath.path()) == 0) {
1795 outcome = m_job_state_results.at(i)->outcome();
1796 break;
1797 }
1798 }
17991774
1800 qDebug() << "Real outcome " << outcome;1775 qDebug() << "Real outcome " << outcome;
18011776
18021777
=== modified file 'plainbox-gui/gui-engine/gui-engine.h'
--- plainbox-gui/gui-engine/gui-engine.h 2013-08-21 11:41:50 +0000
+++ plainbox-gui/gui-engine/gui-engine.h 2013-08-30 15:57:58 +0000
@@ -214,7 +214,7 @@
214 void RunJob(const QDBusObjectPath session, const QDBusObjectPath opath);214 void RunJob(const QDBusObjectPath session, const QDBusObjectPath opath);
215215
216 // Convenience functions216 // Convenience functions
217 const int GetOutcomeFromJobPath(const QDBusObjectPath &opath);217 const int GetOutcomeFromJobResultPath(const QDBusObjectPath &opath);
218218
219 const QString ConvertOutcome(const int outcome);219 const QString ConvertOutcome(const int outcome);
220220

Subscribers

People subscribed via source and target branches