bt2: add missing parameter to _UserComponentType._query
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 21 Jun 2019 15:29:19 +0000 (11:29 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 21 Jun 2019 16:43:10 +0000 (12:43 -0400)
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 <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1530
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/component.py

index 90704262cc627ebfe15ff090b1ef28e67f3fc1c7..b2edd34e49e4515a63a7d234e75671ff01fce4dd 100644 (file)
@@ -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):
This page took 0.026535 seconds and 4 git commands to generate.