Project

General

Profile

Bug #1272

Test failures on Alpine Linux re: python bindings

Added by Russ W 11 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Start date:
06/07/2020
Due date:
% Done:

0%

Estimated time:

Description

Hi,
I am trying to get the test suite to pass on Alpine Linux 3.12 with Python 3.8 but I am running into these failures:

# TAP results for TestAutoDiscoverSourceComponentSpecsGrouping
# bindings/python/bt2/test_python_bt2: TAP results for TestAutoDiscoverSourceComponentSpecsGrouping
not ok 11325 - test_grouping (test_trace_collection_message_iterator.TestAutoDiscoverSourceComponentSpecsGrouping)
FAIL: bindings/python/bt2/test_python_bt2 11325 - test_grouping (test_trace_collection_message_iterator.TestAutoDiscoverSourceComponentSpecsGrouping)
# Traceback (most recent call last):
# bindings/python/bt2/test_python_bt2: Traceback (most recent call last):
#   File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
#     yield
# bindings/python/bt2/test_python_bt2: yield
#   File "/usr/lib/python3.8/unittest/case.py", line 676, in run
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 676, in run
#     self._callTestMethod(testMethod)
# bindings/python/bt2/test_python_bt2: self._callTestMethod(testMethod)
#   File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
#     method()
# bindings/python/bt2/test_python_bt2: method()
#   File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 429, in test_grouping
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 429, in test_grouping
#     it = bt2.TraceCollectionMessageIterator(specs)
# bindings/python/bt2/test_python_bt2: it = bt2.TraceCollectionMessageIterator(specs)
#   File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 327, in __init__
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 327, in __init__
#     self._src_comp_specs += _auto_discover_source_component_specs(
# bindings/python/bt2/test_python_bt2: self._src_comp_specs += _auto_discover_source_component_specs(
#   File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 237, in _auto_discover_source_component_specs
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 237, in _auto_discover_source_component_specs
#     raise RuntimeError(msg)
# bindings/python/bt2/test_python_bt2: raise RuntimeError(msg)
# RuntimeError: Some auto source component specs did not produce any component: ABCDE, /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/grouping
# bindings/python/bt2/test_python_bt2: RuntimeError: Some auto source component specs did not produce any component: ABCDE, /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/grouping
# TAP results for TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel
# bindings/python/bt2/test_python_bt2: TAP results for TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel
not ok 11326 - test_log_level_one_comp_from_one_spec_one_comp_from_both_1 (test_trace_collection_message_iterator.TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel)
FAIL: bindings/python/bt2/test_python_bt2 11326 - test_log_level_one_comp_from_one_spec_one_comp_from_both_1 (test_trace_collection_message_iterator.TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel)
# Traceback (most recent call last):
# bindings/python/bt2/test_python_bt2: Traceback (most recent call last):
#   File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
#     yield
# bindings/python/bt2/test_python_bt2: yield
#   File "/usr/lib/python3.8/unittest/case.py", line 676, in run
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 676, in run
#     self._callTestMethod(testMethod)
# bindings/python/bt2/test_python_bt2: self._callTestMethod(testMethod)
#   File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
#     method()
# bindings/python/bt2/test_python_bt2: method()
#   File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 608, in test_log_level_one_comp_from_one_spec_one_comp_from_both_1
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 608, in test_log_level_one_comp_from_one_spec_one_comp_from_both_1
#     msgs = self._test_one_comp_from_one_spec_one_comp_from_both_1(
# bindings/python/bt2/test_python_bt2: msgs = self._test_one_comp_from_one_spec_one_comp_from_both_1(
#   File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 575, in _test_one_comp_from_one_spec_one_comp_from_both_1
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 575, in _test_one_comp_from_one_spec_one_comp_from_both_1
#     it = bt2.TraceCollectionMessageIterator(specs)
# bindings/python/bt2/test_python_bt2: it = bt2.TraceCollectionMessageIterator(specs)
#   File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 327, in __init__
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 327, in __init__
#     self._src_comp_specs += _auto_discover_source_component_specs(
# bindings/python/bt2/test_python_bt2: self._src_comp_specs += _auto_discover_source_component_specs(
#   File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 237, in _auto_discover_source_component_specs
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 237, in _auto_discover_source_component_specs
#     raise RuntimeError(msg)
# bindings/python/bt2/test_python_bt2: raise RuntimeError(msg)
# RuntimeError: Some auto source component specs did not produce any component: /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-a, /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-ab
# bindings/python/bt2/test_python_bt2: RuntimeError: Some auto source component specs did not produce any component: /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-a, /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-ab
not ok 11327 - test_log_level_one_comp_from_one_spec_one_comp_from_both_2 (test_trace_collection_message_iterator.TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel)
FAIL: bindings/python/bt2/test_python_bt2 11327 - test_log_level_one_comp_from_one_spec_one_comp_from_both_2 (test_trace_collection_message_iterator.TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel)
# Traceback (most recent call last):
# bindings/python/bt2/test_python_bt2: Traceback (most recent call last):
#   File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
#     yield
# bindings/python/bt2/test_python_bt2: yield
#   File "/usr/lib/python3.8/unittest/case.py", line 676, in run
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 676, in run
#     self._callTestMethod(testMethod)
# bindings/python/bt2/test_python_bt2: self._callTestMethod(testMethod)
#   File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
# bindings/python/bt2/test_python_bt2: File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
#     method()
# bindings/python/bt2/test_python_bt2: method()
#   File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 680, in test_log_level_one_comp_from_one_spec_one_comp_from_both_2
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 680, in test_log_level_one_comp_from_one_spec_one_comp_from_both_2
#     msgs = self._test_one_comp_from_one_spec_one_comp_from_both_2(
# bindings/python/bt2/test_python_bt2: msgs = self._test_one_comp_from_one_spec_one_comp_from_both_2(
#   File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 642, in _test_one_comp_from_one_spec_one_comp_from_both_2
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/tests/bindings/python/bt2/test_trace_collection_message_iterator.py", line 642, in _test_one_comp_from_one_spec_one_comp_from_both_2
#     it = bt2.TraceCollectionMessageIterator(specs)
# bindings/python/bt2/test_python_bt2: it = bt2.TraceCollectionMessageIterator(specs)
#   File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 327, in __init__
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 327, in __init__
#     self._src_comp_specs += _auto_discover_source_component_specs(
# bindings/python/bt2/test_python_bt2: self._src_comp_specs += _auto_discover_source_component_specs(
#   File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 237, in _auto_discover_source_component_specs
# bindings/python/bt2/test_python_bt2: File "/home/builder/package/src/babeltrace2-2.0.3/src/bindings/python/bt2/build/build_lib/bt2/trace_collection_message_iterator.py", line 237, in _auto_discover_source_component_specs
#     raise RuntimeError(msg)
# bindings/python/bt2/test_python_bt2: raise RuntimeError(msg)
# RuntimeError: Some auto source component specs did not produce any component: /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-ab, /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-a
# bindings/python/bt2/test_python_bt2: RuntimeError: Some auto source component specs did not produce any component: /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-ab, /home/builder/package/src/babeltrace2-2.0.3/tests/data/auto-source-discovery/params-log-level/dir-a

Could you please assist in what this could be? I have uploaded the test-suite.log.

Thank you,

Russ


Files

test-suite.log (3.87 MB) test-suite.log Russ W, 06/07/2020 04:30 AM
job.log (2.6 MB) job.log Russ W, 06/07/2020 09:35 AM
#2

Updated by Simon Marchi 11 months ago

I just gave it a try in an Alpine Linux docker container, configuring with my usual configure line:

../configure '--enable-python-bindings' 'BABELTRACE_DEV_MODE=1' 'BABELTRACE_DEBUG_MODE=1' '--enable-py
thon-plugins' 'CFLAGS=-fmax-errors=1 -g3 -O0' '--prefix=/tmp/babeltrace' 'CC=ccache gcc' '--enable-Werror' '--enable-python-bindings-
doc' '--enable-api-doc'

and I didn't see a failure when running test_trace_collection_message_iterator.py:

$ ../tests/utils/run_python_bt2 python3 ../tests/bindings/python/bt2/test_trace_collection_message_iterator.py 
......................................................
----------------------------------------------------------------------
Ran 54 tests in 0.575s

OK

So I might need more precise steps to reproduce the issue.

#3

Updated by Russ W 11 months ago

Hi Simon,

Here is the APKBUILD I used:

https://gitlab.alpinelinux.org/alpine/aports/-/blob/3150b2717c1963e6346db9c5401a81ec88e3b131/testing/babeltrace/APKBUILD

    export LDFLAGS="$LDFLAGS -Wl,--no-as-needed" 
    ./configure \
        --build=$CBUILD \
        --host=$CHOST \
        --prefix=/usr \
        --disable-static \
        --disable-debug-info \
        --enable-python-bindings
    make

Does this change the behaviour?

#4

Updated by Russ W 11 months ago

I am building the package with tests on the CI infrastructure. I will have a full build log for you shortly.

#5

Updated by Simon Marchi 11 months ago

Could you please give the set of commands to build from the APKBUILD file and run tests?

#6

Updated by Simon Marchi 11 months ago

Btw, I ran a full "make check" on my build and I do see some other failures. They seem to be caused by flags not recognized by BusyBox's grep or other tools.

#7

Updated by Russ W 11 months ago

Here is the full build+test log running on CI: https://gitlab.alpinelinux.org/russkel/aports/-/jobs/137284
I have attached it also.

On my PC I use docker-alpine-abuild https://github.com/andyshinn/docker-alpine-abuild. But on yours you should be able to something like

mkdir /tmp/babeltrace
mv APKBUILD /tmp/babeltrace
sudo apk add alpine-sdk coreutils
cd /tmp/babeltrace
abuild -rK

I am aware of the grep/bash issues and have accounted for that in the "checkdepends" field of the APKBUILD. I don't believe these python test failures are caused by that?

#8

Updated by Russ W 11 months ago

#9

Updated by Simon Marchi 11 months ago

Russ W wrote in #note-7:

Here is the full build+test log running on CI: https://gitlab.alpinelinux.org/russkel/aports/-/jobs/137284
I have attached it also.

On my PC I use docker-alpine-abuild https://github.com/andyshinn/docker-alpine-abuild. But on yours you should be able to something like

[...]

I am aware of the grep/bash issues and have accounted for that in the "checkdepends" field of the APKBUILD. I don't believe these python test failures are caused by that?

Ah ok, so if I install these I'll get the GNU versions of the tools, so these failures should go away. I'll try that later.

#10

Updated by Simon Marchi 11 months ago

Ok, got it. Add --enable-python-plugins as well in your configure line (it's new in version 2).

The test that is failing for you actually depends on support for Python plugins. This needs to be fixed on our end, the test should be skipped if Python plugin support is not enabled. But adding the flag on your end will unblock you.

The difference between the two is subtle, so FYI:

  • Python bindings: lets you write a "main" program in Python that uses the Babeltrace 2 library.
  • Python plugins: lets you write new component classes (read: plugins for trace formats) in Python (which can then be used from a "main" program written in whatever language).

Enabling Python plugins requires Python bindings to be enabled, but Python bindings can be enabled without Python plugins.

#12

Updated by Russ W 11 months ago

Hi Simon, that has sorted it out. I enabled both which is probably what I wanted in the first place.

Thanks a lot for your help.

#13

Updated by Jérémie Galarneau 10 months ago

  • Status changed from New to Resolved

Also available in: Atom PDF