Merge lp:~roadmr/checkbox/1232232-gpu-test-fixes into lp:checkbox

Proposed by Daniel Manrique
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 2396
Merged at revision: 2398
Proposed branch: lp:~roadmr/checkbox/1232232-gpu-test-fixes
Merge into: lp:checkbox
Diff against target: 59 lines (+18/-4)
2 files modified
checkbox-old/debian/changelog (+6/-0)
checkbox-old/scripts/gpu_test (+12/-4)
To merge this branch: bzr merge lp:~roadmr/checkbox/1232232-gpu-test-fixes
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+188160@code.launchpad.net

Commit message

scripts/gpu_test: Better validation that glxgears windows were found.

This is to avoid manipulation of nonexisting windows which causes
threads to crash and the entire program to stall.

Description of the change

scripts/gpu_test: Better validation that glxgears windows were found.

This is to avoid manipulation of nonexisting windows which causes
threads to crash and the entire program to stall.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-old/debian/changelog'
2--- checkbox-old/debian/changelog 2013-09-20 15:34:47 +0000
3+++ checkbox-old/debian/changelog 2013-09-27 20:39:01 +0000
4@@ -1,7 +1,13 @@
5 checkbox (0.16.12) UNRELEASED; urgency=low
6
7+ [ Brendan Donegan ]
8 * Incremented changelog
9
10+ [ Daniel Manrique ]
11+ * scripts/gpu_test: Better validation that glxgears windows were found, to
12+ avoid manipulation of nonexisting windows which causes threads to crash
13+ and the entire program to stall. (LP: #1232232)
14+
15 -- Brendan Donegan <brendan.donegan@canonical.com> Fri, 20 Sep 2013 16:10:13 +0100
16
17 checkbox (0.16.11) saucy; urgency=low
18
19=== modified file 'checkbox-old/scripts/gpu_test'
20--- checkbox-old/scripts/gpu_test 2013-08-30 14:54:37 +0000
21+++ checkbox-old/scripts/gpu_test 2013-09-27 20:39:01 +0000
22@@ -46,7 +46,11 @@
23 shell=True)
24
25 def terminate(self):
26- subprocess.call('wmctrl -i -c %s' % self.id, shell=True)
27+ if hasattr(self, 'id'):
28+ subprocess.call('wmctrl -i -c %s' % self.id, shell=True)
29+ else:
30+ print("WARNING: Attempted to terminate non-existing window.")
31+
32
33
34 class RotateGlxThread(Thread):
35@@ -168,8 +172,11 @@
36 GlxWindows[i].id = str(
37 re.match(b'^(0x\w+)', app).group(0), 'utf-8')
38 break
39- GlxRotate.append(RotateGlxThread(GlxWindows[i].id, i + 1))
40- GlxRotate[i].start()
41+ if hasattr(GlxWindows[i], "id"):
42+ GlxRotate.append(RotateGlxThread(GlxWindows[i].id, i + 1))
43+ GlxRotate[i].start()
44+ else:
45+ print("WARNING: Window {} not found, not rotating it.".format(i))
46
47 hsize = vsize = 2
48 hsize_ori = vsize_ori = None
49@@ -199,8 +206,9 @@
50
51 time.sleep(35)
52
53- for i in range(2):
54+ for i in range(len(GlxRotate)):
55 GlxRotate[i].cancel = True
56+ for i in range(len(GlxWindows)):
57 GlxWindows[i].terminate()
58 DesktopSwitch.cancel = True
59 time.sleep(10)

Subscribers

People subscribed via source and target branches