bt2: add missing parameter to _UserComponentType._query
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 21 Jun 2019 15:29:19 +0000 (11:29 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Jul 2019 15:53:32 +0000 (11:53 -0400)
commitc7fdd8d69cafa717955cf01583a0058b18998d8b
tree917c33740a73f98a268dfb97f32c7647425021a2
parent29e15f4be64d2efc07bda7de5f21cfdec755c770
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.026232 seconds and 4 git commands to generate.