From 9cf25bf277fee373465b13e2f4f11cc62cff0bd3 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 21 Jun 2019 11:29:19 -0400 Subject: [PATCH] bt2: add missing parameter to _UserComponentType._query While running the Python test suite, I saw this unexpected stack trace: test_query_not_implemented (test_component_class.UserComponentClassTestCase) ... 06-21 11:22:56.091 24065 24065 E BT2-PY bt_py3_component_class_query@native_bt_wrap.c:4442 Failed to call Python class's _query_from_native() method: py-cls-addr=0x6190001ce898 06-21 11:22:56.092 24065 24065 E BT2-PY bt2_py_loge_exception@native_bt_wrap.c:3838 Traceback (most recent call last): File "/home/smarchi/build/babeltrace/src/bindings/python/bt2/build/build_lib/bt2/component.py", line 539, in _query_from_native results = cls._query(query_exec, obj, params, log_level) TypeError: _query() takes 4 positional arguments but 5 were given This is because method _UserComponentType._query is missing the log_level argument that was added in a recent commit. The reason the test still passes is that it expects bt2.Error to be raised (coming from the raise NotImplementedError). The failure to call _query also ends up raising a bt2.Error. So it succeeds to fail, but it doesn't fail the right way, and the test fails to properly catch that failure. Change-Id: If13bfdecc2876610fe8568a12043be60762d1596 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1530 Tested-by: jenkins Reviewed-by: Philippe Proulx --- src/bindings/python/bt2/bt2/component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index 90704262..b2edd34e 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -549,7 +549,7 @@ class _UserComponentType(type): return results_addr - def _query(cls, query_executor, obj, params): + def _query(cls, query_executor, obj, params, log_level): raise NotImplementedError def _component_class_ptr(self): -- 2.34.1