Skip to content

Commit

Permalink
Merge pull request ARM-software#177 from JaviMerino/fix_little_cpus_t…
Browse files Browse the repository at this point in the history
…est_idle_pull

tests/eas/acceptance: increase accuracy of little cpus test in the Offload Migration testcase
  • Loading branch information
mdigiorgio authored Sep 16, 2016
2 parents 38d43e5 + a43cb2f commit b9eb252
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/eas/acceptance.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"STEP_HIGH_DCYCLE" : 50,
"EXPECTED_RESIDENCY_PCT" : 85,
"OFFLOAD_MIGRATION_MIGRATOR_DELAY": 1,
"EXPECTED_BIG_BUSY_TIME_PCT": 99,
"OFFLOAD_EXPECTED_BUSY_TIME_PCT": 99,
"TEST_CONF" : {
"modules" : [ "bl", "cpufreq" ],
"tools" : [ "rt-app" ],
Expand Down
12 changes: 9 additions & 3 deletions tests/eas/acceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,12 @@ def calculate_end_times(cls):

return end_times

def get_migrator_activation_time(self):
start_times_dict = self.m_assert.getStartTime()
start_time = min(t['starttime'] for t in start_times_dict.itervalues())

return start_time + OFFLOAD_MIGRATION_MIGRATOR_DELAY

def test_first_cpu_early_starters(self):
"""Offload Migration and Idle Pull: Test First CPU (Early Starters)"""

Expand Down Expand Up @@ -452,7 +458,7 @@ def test_big_cpus_fully_loaded(self):
self.env.target.bl.bigs,
window=window, percent=True)

expected_busy_time = EXPECTED_BIG_BUSY_TIME_PCT * \
expected_busy_time = OFFLOAD_EXPECTED_BUSY_TIME_PCT * \
big_cpus_left / num_big_cpus
msg = "Big tasks were not running on big cpus from {} to {}".format(
window[0], window[1])
Expand All @@ -470,14 +476,14 @@ def test_little_cpus_run_tasks(self):
if not first_task_finish_time or (end_time < first_task_finish_time):
first_task_finish_time = end_time

window = (OFFLOAD_MIGRATION_MIGRATOR_DELAY, first_task_finish_time)
window = (self.get_migrator_activation_time(), first_task_finish_time)
busy_time = self.a_assert.getCPUBusyTime("cluster",
self.env.target.bl.littles,
window=window)

window_len = window[1] - window[0]
expected_busy_time = window_len * num_offloaded_tasks * \
EXPECTED_BIG_BUSY_TIME_PCT / 100.
OFFLOAD_EXPECTED_BUSY_TIME_PCT / 100.
msg = "Little cpus did not pick up big tasks while big cpus were fully loaded"

self.assertGreater(busy_time, expected_busy_time, msg=msg)
Expand Down

0 comments on commit b9eb252

Please sign in to comment.