aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ftrace.py
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-12-22 17:15:32 +0000
committerJavi Merino <javi.merino@arm.com>2015-12-22 17:15:32 +0000
commita5db2d84050d18299f20c227b5f82895584a3c79 (patch)
treef43214404ca4c2ad0493a67de6115bc56b91b59d /tests/test_ftrace.py
parentb280b4fd175789648650f66ed5fb3b4f42fb3de2 (diff)
downloadtrappy-a5db2d84050d18299f20c227b5f82895584a3c79.tar.gz
tests: unregister dynamically created classes in the tests
The classes registered dynamically in the tests persist across the execution of the testsuite. That makes the testsuite sometimes fail if a test has added a class to the sched scope and test_ftrace_has_all_classes_scope_sched() run concurrently. Unregister the dynamic events when the tests that register them finish.
Diffstat (limited to 'tests/test_ftrace.py')
-rw-r--r--tests/test_ftrace.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_ftrace.py b/tests/test_ftrace.py
index 82fa404..657f801 100644
--- a/tests/test_ftrace.py
+++ b/tests/test_ftrace.py
@@ -82,11 +82,14 @@ class TestFTrace(BaseTestThermal):
for attr in trace.sched_classes.iterkeys():
self.assertFalse(hasattr(trace, attr))
- trappy.register_dynamic_ftrace("ADynamicEvent", "a_dynamic_event")
+ ftrace_parser = trappy.register_dynamic_ftrace("ADynamicEvent",
+ "a_dynamic_event")
trace = trappy.FTrace(scope="custom")
self.assertTrue(hasattr(trace, "a_dynamic_event"))
+ trappy.unregister_dynamic_ftrace(ftrace_parser)
+
def test_ftrace_doesnt_overwrite_parsed_event(self):
"""FTrace().add_parsed_event() should not override an event that's already present"""