aboutsummaryrefslogtreecommitdiff
path: root/tests/test_base.py
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-03-30 15:38:43 +0100
committerJavi Merino <javi.merino@arm.com>2015-08-12 16:03:46 +0100
commit69c59882c6af7c496a6eb864cdf2e6e4e3444ee1 (patch)
tree3f760b5344223944d82c788704ab6e5b2dca62ca /tests/test_base.py
parent64965eb65c62be4fbc41f5fb6a8093bfa0e20315 (diff)
downloadtrappy-69c59882c6af7c496a6eb864cdf2e6e4e3444ee1.tar.gz
tests: make test_parse_values_concatenation() operate on a unique trace
event When running nosetests from the tests/ directory, all tests are run within the same import of cr2. Therefore, invocations of register_dynamic() are persistent and affect the tests that follow them. test_run_basetime_empty(), test_run_normalize_some_tracepoints() and test_empty_trace_txt() all expect that the file they are parsing doesn't have any known traces. Because the register_dynamic() in test_parse_values_concatenation() is persistent, they now parse that trace and that makes these tests fail. Again, this only happens if nosetests is run from the tests/ directory. Change the event registered by test_parse_values_concatenation() to something unique and not present in the "empty" traces, so that the tests that expect to parse a file without meaningful traces succeed. Change-Id: I31ac4f0ad636c28d49e0db5345d9a27d8bd62d6c Signed-off-by: Javi Merino <javi.merino@arm.com>
Diffstat (limited to 'tests/test_base.py')
-rw-r--r--tests/test_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_base.py b/tests/test_base.py
index 615beb8..0665b02 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -85,14 +85,14 @@ class TestBase(utils_tests.SetupDirectory):
def test_parse_values_concatenation(self):
"""TestBase: Trace with space separated values created a valid DataFrame"""
- in_data = """ rcu_preempt-7 [000] 73.604532: sched_stat_runtime: comm=Space separated taskname pid=7 runtime=262875 [ns] vruntime=17096359856 [ns]"""
+ in_data = """ rcu_preempt-7 [000] 73.604532: my_sched_stat_runtime: comm=Space separated taskname pid=7 runtime=262875 [ns] vruntime=17096359856 [ns]"""
expected_columns = set(["__comm", "__pid", "__cpu", "comm", "pid", "runtime", "vruntime"])
with open("trace.txt", "w") as fout:
fout.write(in_data)
- cr2.register_dynamic('sched_stat_runtime', 'sched_stat_runtime',
+ cr2.register_dynamic('sched_stat_runtime', 'my_sched_stat_runtime',
scope="sched")
run = cr2.Run()
dfr = run.sched_stat_runtime.data_frame