Merge ~kevinbecker/+git/autotest-client-tests:kevinbecker/rt-thresholds into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Kevin Becker
Status: Merged
Merge reported by: Po-Hsu Lin
Merged at revision: 647c4e7448e9e20ee5eb6adfd79e6076e6b70b2d
Proposed branch: ~kevinbecker/+git/autotest-client-tests:kevinbecker/rt-thresholds
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 163 lines (+44/-14)
4 files modified
rt_tests_cyclictest/rt_tests_cyclictest.py (+11/-3)
rt_tests_pmqtest/rt_tests_pmqtest.py (+13/-5)
rt_tests_ptsematest/rt_tests_ptsematest.py (+10/-3)
rteval/rteval.py (+10/-3)
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Francis Ginther Pending
Sean Feole Pending
Canonical Kernel Team Pending
Review via email: mp+465507@code.launchpad.net

Commit message

UBUNTU: SAUCE: Update max latency handling of rt tests to better handle ivysaur

The original limits were set for starlow and were probably set a little too tightly. Relax limits since we only want to fail on a clearly too high max latency. This commit also allows per host latency limits since ivysaur has more latency than starlow.

Signed-off-by: Kevin Becker <email address hidden>

To post a comment you must log in.
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hi Kevin,
overall this is looking good.
But there is one line need to be fixed, and I have some suggestions to add '-b' flag into args. As it's indeed an arg that we need to pass into the program. In this way I think it's more readable.

Please find inline comments.
Thanks

review: Needs Fixing
Revision history for this message
Kevin Becker (kevinbecker) wrote :

> Hi Kevin,
> overall this is looking good.
> But there is one line need to be fixed, and I have some suggestions to add
> '-b' flag into args. As it's indeed an arg that we need to pass into the
> program. In this way I think it's more readable.
>
> Please find inline comments.
> Thanks

Thanks Sam! Good catch on the missing space. I've incorporated your changes and I will retest on starlow later today.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

+1.
Let's move on to get this landed. Please feel free to open a new MP for more adjustments.
Applied with comment break in multiple lines and pushed.

Revision history for this message
Po-Hsu Lin (cypressyew) :
review: Approve
Revision history for this message
Kevin Becker (kevinbecker) wrote :

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/rt_tests_cyclictest/rt_tests_cyclictest.py b/rt_tests_cyclictest/rt_tests_cyclictest.py
2index ac8d2ac..4cd1cb1 100644
3--- a/rt_tests_cyclictest/rt_tests_cyclictest.py
4+++ b/rt_tests_cyclictest/rt_tests_cyclictest.py
5@@ -12,6 +12,7 @@ class rt_tests_cyclictest(test.test):
6 def initialize(self):
7 self.flavour = re.split('-\d*-', platform.uname()[2])[-1]
8 self.arch = platform.processor()
9+ self.hostname = os.uname()[1]
10
11 def install_required_pkgs(self):
12 try:
13@@ -65,16 +66,23 @@ class rt_tests_cyclictest(test.test):
14 #
15 # Runs cyclictest with 10 threads, for 100000 loops, priority set to
16 # 80 and an interval of 200us. It will fail if the max latency goes
17- # over 100us.
18+ # over a specified latency.
19 #
20- def run_once(self, test_name, args='-t 10 -m -l 100000 -p 80 -b 100 -i 200 -d 0', exit_on_error=True):
21+ def run_once(self, test_name, args='-t 10 -m -l 100000 -p 80 -i 200 -d 0', exit_on_error=True):
22 if test_name == 'setup':
23 return
24+
25+ latency_limit = 1000
26+ if self.hostname == 'starlow':
27+ latency_limit = 200
28+ elif self.hostname == 'ivysaur':
29+ latency_limit = 700
30
31+ args += ' -b ' + str(latency_limit)
32 self.results = utils.system_output(self.srcdir + '/rt-tests/cyclictest ' + args, retain_output=True)
33
34 if "Break" == self.results.splitlines()[-1].split()[1]:
35- raise error.TestError('FAIL: Max latency over 100us.')
36+ raise error.TestError('FAIL: Max latency over ' + str(latency_limit) + 'us.')
37
38 return
39
40diff --git a/rt_tests_pmqtest/rt_tests_pmqtest.py b/rt_tests_pmqtest/rt_tests_pmqtest.py
41index d9e3fda..a55565a 100644
42--- a/rt_tests_pmqtest/rt_tests_pmqtest.py
43+++ b/rt_tests_pmqtest/rt_tests_pmqtest.py
44@@ -12,6 +12,7 @@ class rt_tests_pmqtest(test.test):
45 def initialize(self):
46 self.flavour = re.split('-\d*-', platform.uname()[2])[-1]
47 self.arch = platform.processor()
48+ self.hostname = os.uname()[1]
49
50 def install_required_pkgs(self):
51 try:
52@@ -63,12 +64,19 @@ class rt_tests_pmqtest(test.test):
53 #
54 # Driven by the control file for each individual test.
55 #
56- # Runs pmqtest for 60 seconds. This will fail if the max latency is over 100us.
57+ # Runs pmqtest for 60 seconds. This will fail if the max latency is over a specified limit.
58 #
59- def run_once(self, test_name, args='-Sp80 -i100 -d0 -b100 -q -D60', exit_on_error=True):
60+ def run_once(self, test_name, args='-Sp80 -i100 -d0 -q -D60', exit_on_error=True):
61 if test_name == 'setup':
62 return
63+
64+ latency_limit = 1000
65+ if self.hostname == 'starlow':
66+ latency_limit = 200
67+ elif self.hostname == 'ivysaur':
68+ latency_limit = 700
69
70+ args += ' -b' + str(latency_limit)
71 self.results = utils.system_output(self.srcdir + '/rt-tests/pmqtest ' + args, retain_output=True)
72
73 lines = self.results.split('\n')
74@@ -78,8 +86,8 @@ class rt_tests_pmqtest(test.test):
75 if 'Max' in line:
76 max_latencies.append(int(line.split()[-1]))
77
78- # Check if any max value is over 100
79- if any(value > 100 for value in max_latencies):
80- raise error.TestError('FAIL: Max latency over 100us.')
81+ # Check if any max value is over latency limit
82+ if any(value > latency_limit for value in max_latencies):
83+ raise error.TestError('FAIL: Max latency over ' + str(latency_limit) + 'us.')
84
85 return
86diff --git a/rt_tests_ptsematest/rt_tests_ptsematest.py b/rt_tests_ptsematest/rt_tests_ptsematest.py
87index 4bd6456..aa29b96 100644
88--- a/rt_tests_ptsematest/rt_tests_ptsematest.py
89+++ b/rt_tests_ptsematest/rt_tests_ptsematest.py
90@@ -12,6 +12,7 @@ class rt_tests_ptsematest(test.test):
91 def initialize(self):
92 self.flavour = re.split('-\d*-', platform.uname()[2])[-1]
93 self.arch = platform.processor()
94+ self.hostname = os.uname()[1]
95
96 def install_required_pkgs(self):
97 try:
98@@ -64,11 +65,17 @@ class rt_tests_ptsematest(test.test):
99 # Driven by the control file for each individual test.
100 #
101 # Runs ptsematest with one thread per processor, for 100000 loops, and
102- # priority set to 80. It will fail if the max latency goes over 100us.
103+ # priority set to 80. It will fail if the max latency goes over a specified limit.
104 #
105 def run_once(self, test_name, args='-l 100000 -p 80 -S -q', exit_on_error=True):
106 if test_name == 'setup':
107 return
108+
109+ latency_limit = 1000
110+ if self.hostname == 'starlow':
111+ latency_limit = 200
112+ elif self.hostname == 'ivysaur':
113+ latency_limit = 700
114
115 self.results = utils.system_output(self.srcdir + '/rt-tests/ptsematest ' + args, retain_output=True)
116
117@@ -88,7 +95,7 @@ class rt_tests_ptsematest(test.test):
118 highest_max = max(max_values)
119 print("Highest Max Latency:", highest_max)
120
121- if highest_max > 100:
122- raise error.TestError('FAIL: Max latency over 100us.')
123+ if highest_max > latency_limit:
124+ raise error.TestError('FAIL: Max latency over ' + str(latency_limit) + 'us.')
125
126 return
127diff --git a/rteval/rteval.py b/rteval/rteval.py
128index 15c9b2a..821c763 100644
129--- a/rteval/rteval.py
130+++ b/rteval/rteval.py
131@@ -14,6 +14,7 @@ class rteval(test.test):
132 def initialize(self):
133 self.flavour = re.split('-\d*-', platform.uname()[2])[-1]
134 self.arch = platform.processor()
135+ self.hostname = os.uname()[1]
136
137 def install_required_pkgs(self):
138 try:
139@@ -100,7 +101,7 @@ class rteval(test.test):
140 #
141 # Driven by the control file for each individual test.
142 #
143- # Runs rteval. Test passes if max latency is not over 200us.
144+ # Runs rteval. Test passes if max latency is not over specified limit.
145 #
146 def run_once(self, test_name, args='', exit_on_error=True):
147 if test_name == 'setup':
148@@ -137,7 +138,13 @@ class rteval(test.test):
149 latency = maximum_tag.text
150 print("Maximum latency: "+latency+"us")
151
152- if int(latency) > 200:
153- raise error.TestError('FAIL: Max latency too high.')
154+ latency_limit = 1000
155+ if self.hostname == 'starlow':
156+ latency_limit = 200
157+ elif self.hostname == 'ivysaur':
158+ latency_limit = 800
159+
160+ if int(latency) > latency_limit:
161+ raise error.TestError('FAIL: Max latency over ' + str(latency_limit) + 'us.')
162
163 return

Subscribers

People subscribed via source and target branches