Project

General

Profile

Actions

Bug #1430

open
MY

./tests/python-plugin-provider/test-python-plugin-provider.sh fails

Bug #1430: ./tests/python-plugin-provider/test-python-plugin-provider.sh fails

Added by Mingli Yu 4 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
07/24/2025
Due date:
% Done:

0%

Estimated time:

Description

./tests/python-plugin-provider/test-python-plugin-provider.sh
  1. TAP results for PythonPluginProviderTestCase
    not ok 1 test_python_plugin_provider (test_python_plugin_provider.PythonPluginProviderTestCase.test_python_plugin_provider)
  2. Traceback (most recent call last):
  3. File "/usr/lib/python3.13/unittest/case.py", line 58, in testPartExecutor
  4. yield
  5. File "/usr/lib/python3.13/unittest/case.py", line 651, in run
  6. self._callTestMethod(testMethod)
  7. ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  8. File "/usr/lib/python3.13/unittest/case.py", line 606, in _callTestMethod
  9. if method() is not None:
  10. ~~~~^^
  11. File "/usr/lib/babeltrace2/ptest/tests/python-plugin-provider/test_python_plugin_provider.py", line 16, in test_python_plugin_provider
  12. self.assertEqual(len(pset), 1)
  13. ~~~^^^^^^
  14. TypeError: object of type 'NoneType' has no len()
    1..1

Files

babeltrace_test_failed (229 KB) babeltrace_test_failed Mingli Yu, 07/24/2025 05:20 AM

MY Updated by Mingli Yu 4 months ago Actions #1

The full failed test case as the attached babeltrace_test_failed.

MY Updated by Mingli Yu 3 months ago Actions #2

07-31 08:37:45.773 15193 15193 E CLI add_descriptor_to_component_descriptor_set@../../../sources/babeltrace2-2.1.1/src/cli/babeltrace2.c:1728 Cannot find component class: plugin-name="test-pretty", comp-cls-name="TheSourceOfProblems", comp-cls-type=SOURCE
07-31 08:37:45.774 15193 15193 E CLI cmd_run_ctx_init@../../../sources/babeltrace2-2.1.1/src/cli/babeltrace2.c:1923 Cannot find an operative message interchange protocol version to use to create the `run` command's graph: status=ERROR

When run the test tests/plugins/sink.text.pretty/test-enum.sh, it fails as below:

07-31 08:37:45.774 15193 15193 E CLI cmd_run@../../../sources/babeltrace2-2.1.1/src/cli/babeltrace2.c:2507 Cannot initialize the command's context.

ERROR: [Babeltrace CLI] (../../../sources/babeltrace2-2.1.1/src/cli/babeltrace2.c:2507)
Cannot initialize the command's context.
CAUSED BY [Babeltrace CLI] (../../../sources/babeltrace2-2.1.1/src/cli/babeltrace2.c:1923)
Cannot find an operative message interchange protocol version to use to create
the `run` command's graph: status=ERROR
CAUSED BY [Babeltrace CLI] (../../../sources/babeltrace2-2.1.1/src/cli/babeltrace2.c:1728)
Cannot find component class: plugin-name="test-pretty",
comp-cls-name="TheSourceOfProblems", comp-cls-type=SOURCE

SM Updated by Simon Marchi 3 months ago Actions #3

It looks like the Python plugin provider is failing to provide Python plugins. One would have to step into the code to really know why.

Can you provide details about the platform, configure flags, etc, so there is a chance we can reproduce?

MY Updated by Mingli Yu 3 months ago Actions #4

Please use below steps to reproduce the issues. Thanks!

1, mkdir -p /mywork/builds
2, cd /mywork/ && git clone git://git.yoctoproject.org/poky
3, cd poky && . oe-init-build-env ../builds/test-build
4, bitbake core-image-ptest-babeltrace2
5, runqemu qemux86-64 nographic qemuparams="-m 2048"
6, cd /usr/lib/babeltrace2/ptest && ./run-ptest

SM Updated by Simon Marchi 3 months ago Actions #5

Ok, you are on Yocto. It might be related to this issue, where Yocto is using a testsuite setup that isn't supported:

https://bugs.lttng.org/issues/1423

MY Updated by Mingli Yu 3 months ago Actions #6

Thanks for your pointer to https://bugs.lttng.org/issues/1423! Have checked the history of https://bugs.lttng.org/issues/1423 and the plugin under .libs actually have deployed in my system as below. # ls /usr/lib/babeltrace2/ptest/tests/lib/test-plugins-plugins/
plugin-minimal.so plugin-sfs.so

Could you help to guide how to resolve the issue?

Thanks!

MY Updated by Mingli Yu 3 months ago Actions #7

BTW, could you help to guide to make bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=False) also finds the text plugin? The details as below:
```
  1. python3
    Python 3.13.5 (main, Jun 11 2025, 15:36:57) [GCC 15.1.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.

import bt2
bt2.find_plugin("text", find_in_user_dir=False, find_in_sys_dir=False)
bt2.find_plugin("text")

<bt2.plugin._Plugin object @ 0x5588dc52b400>

```

SM Updated by Simon Marchi 3 months ago Actions #8

Mingli Yu wrote in #note-6:

Thanks for your pointer to https://bugs.lttng.org/issues/1423! Have checked the history of https://bugs.lttng.org/issues/1423 and the plugin under .libs actually have deployed in my system as below.
  1. ls /usr/lib/babeltrace2/ptest/tests/lib/test-plugins-plugins/
    plugin-minimal.so plugin-sfs.so

Could you help to guide how to resolve the issue?

Thanks!

So, you are showing the output of test tests/plugins/sink.text.pretty/test-enum.sh I think. The plugins written specifically for the tests are found using

data_dir="$BT_TESTS_DATADIR/plugins/sink.text.pretty" 
...
    "--plugin-path" "$data_dir" 

BT_TESTS_DATADIR is defined using

# Directory containing test data
BT_TESTS_DATADIR=$BT_TESTS_SRCDIR/data

So, you could try setting BT_TESTS_SRCDIR to something like /usr/lib/babeltrace2/ptest/tests prior to running the testsuite. The goal is that the value passed to --plugin-path points to the directory containing bt_plugin_pretty_test.py.

Keep in mind that this is not a supported way of running the testsuite, so you are a bit on your own here, you might have to do some digging in the code.

KS Updated by Kienan Stewart 3 months ago Actions #9

After discussions and work with @rpurdie, @Michael Jeanson provided the following wip patch for the yocto project: https://git.multivax.ca/mjeanson/poky-contrib/commit/c8b74187d50946df40a07923edf70db0bb481901

I think that resolves this issue

Actions

Also available in: PDF Atom