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
1=== modified file 'plainbox-gui/gui-engine/gui-engine.cpp'
2--- plainbox-gui/gui-engine/gui-engine.cpp 2013-08-21 11:41:50 +0000
3+++ plainbox-gui/gui-engine/gui-engine.cpp 2013-08-30 15:57:58 +0000
4@@ -576,7 +576,7 @@
5 * Selection screen as additional implicit jobs
6 */
7
8-int GuiEngine::PrepareJobs(void)
9+int GuiEngine::PrepareJobs(void)
10 {
11
12 qDebug("\n\nGuiEngine::PrepareJobs()\n");
13@@ -1290,15 +1290,8 @@
14 QString job_cmd = GetCommand(m_run_list.at(m_current_job_index));
15
16
17- // Get the interim Job Results
18- GetJobStateMap();
19-
20- GetJobStates();
21-
22- GetJobResults();
23-
24 // we should look up the prior job result if available
25- int outcome = GetOutcomeFromJobPath(m_run_list.at(m_current_job_index));
26+ int outcome = GetOutcomeFromJobResultPath(m_run_list.at(m_current_job_index));
27
28 // Open the GUI dialog -- TODO - Default the Yes/No/Skip icons
29 if (!m_running_manual_job) {
30@@ -1310,7 +1303,6 @@
31 emit updateManualInteractionDialog(outcome);
32 }
33
34-
35 qDebug("GuiEngine::CatchallAskForOutcomeSignalsHandler - Done");
36 }
37
38@@ -1350,6 +1342,9 @@
39 case PBTreeNode::PBJobResult_Skip:
40 return JobResult_OUTCOME_SKIP;
41 break;
42+
43+ default:
44+ return JobResult_OUTCOME_NONE;
45 }
46 }
47
48@@ -1638,15 +1633,8 @@
49
50 UpdateJobResult(m_session,job,result);
51
52- // Get the interim Job Results
53- GetJobStateMap();
54-
55- GetJobStates();
56-
57- GetJobResults();
58-
59- // How did this job turn out?
60- int outcome = GetOutcomeFromJobPath(m_run_list.at(m_current_job_index));
61+ // How did this job turn out?
62+ int outcome = GetOutcomeFromJobResultPath(result);
63
64 // Update the GUI so it knows what the job outcome was
65 emit updateGuiObjects(m_run_list.at(m_current_job_index).path(), \
66@@ -1769,33 +1757,20 @@
67 return empty;
68 }
69
70-const int GuiEngine::GetOutcomeFromJobPath(const QDBusObjectPath &opath)
71+const int GuiEngine::GetOutcomeFromJobResultPath(const QDBusObjectPath &opath)
72 {
73 QString outcome;
74- int result = 0;
75
76 /* first, we need to go through the m_job_state_list to find the
77 * relevant job to result mapping. then we go through m_job_state_results
78 * to obtain the actual result.
79 */
80
81- QDBusObjectPath resultpath;
82-
83- for(int i=0; i < m_job_state_list.count(); i++) {
84- if (m_job_state_list.at(i)->job().path().compare(opath.path()) == 0) {
85- // ok, we found the right statelist entry
86- resultpath = m_job_state_list.at(i)->result();
87- break;
88- }
89- }
90-
91- // Now to find the right result object
92- for(int i=0;i<m_job_state_results.count();i++) {
93- if (m_job_state_results.at(i)->object_path.path().compare(resultpath.path()) == 0) {
94- outcome = m_job_state_results.at(i)->outcome();
95- break;
96- }
97- }
98+ PBTreeNode* result_node = new PBTreeNode();
99+ result_node->AddNode(result_node, opath);
100+ outcome = result_node->outcome();
101+
102+ delete result_node;
103
104 qDebug() << "Real outcome " << outcome;
105
106
107=== modified file 'plainbox-gui/gui-engine/gui-engine.h'
108--- plainbox-gui/gui-engine/gui-engine.h 2013-08-21 11:41:50 +0000
109+++ plainbox-gui/gui-engine/gui-engine.h 2013-08-30 15:57:58 +0000
110@@ -214,7 +214,7 @@
111 void RunJob(const QDBusObjectPath session, const QDBusObjectPath opath);
112
113 // Convenience functions
114- const int GetOutcomeFromJobPath(const QDBusObjectPath &opath);
115+ const int GetOutcomeFromJobResultPath(const QDBusObjectPath &opath);
116
117 const QString ConvertOutcome(const int outcome);
118

Subscribers

People subscribed via source and target branches