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)
commit9cf25bf277fee373465b13e2f4f11cc62cff0bd3
tree4622a22717ac7d95a8580c69e2edbe9ecb7b2d45
parent274a82adf9b62f1d4ab764444dfdbf232d7587f5
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 <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
This page took 0.025947 seconds and 4 git commands to generate.