Merge lp:~pieq/checkbox/fix-1569191-stress-test-log-time-check into lp:checkbox

Proposed by Pierre Equoy
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4300
Merged at revision: 4300
Proposed branch: lp:~pieq/checkbox/fix-1569191-stress-test-log-time-check
Merge into: lp:checkbox
Diff against target: 40 lines (+6/-6)
1 file modified
providers/plainbox-provider-checkbox/bin/sleep_time_check (+6/-6)
To merge this branch: bzr merge lp:~pieq/checkbox/fix-1569191-stress-test-log-time-check
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+291595@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Tested using the same way described in the bug report:

touch /tmp/test.log
./sleep_time_check /tmp/test.log

It works now, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'providers/plainbox-provider-checkbox/bin/sleep_time_check'
2--- providers/plainbox-provider-checkbox/bin/sleep_time_check 2015-10-01 07:12:33 +0000
3+++ providers/plainbox-provider-checkbox/bin/sleep_time_check 2016-04-12 09:08:02 +0000
4@@ -33,7 +33,7 @@
5 lines = file.readlines()
6 except IOError as e:
7 print(e)
8- return False
9+ return 1
10
11 sleep_time = None
12 sleep_times = []
13@@ -51,23 +51,23 @@
14 if (sleep_time is None or resume_time is None) or \
15 (len(sleep_times) != len(resume_times)):
16 print("ERROR: One or more times was not reported correctly")
17- return False
18+ return 1
19
20 print("Average time to enter sleep state: %.4f seconds" % mean(sleep_times))
21 print("Average time to resume from sleep state: %.4f seconds" % mean(resume_times))
22
23- failed = False
24+ failed = 0
25 if sleep_time > args.sleep_threshold:
26 print("System failed to suspend in less than %s seconds" %
27 args.sleep_threshold)
28- failed = True
29+ failed = 1
30 if resume_time > args.resume_threshold:
31 print("System failed to resume in less than %s seconds" %
32 args.resume_threshold)
33- failed = True
34+ failed = 1
35 if sleep_time <= 0.00 or resume_time <= 0.00:
36 print("ERROR: One or more times was not reported correctly")
37- failed = True
38+ failed = 1
39
40 return failed
41

Subscribers

People subscribed via source and target branches